def preprocessImg(imgPath, clipSize):
if clipSize != 0:
im = enhance(imgPath, clipSize)
else:
im = cv2.imread(imgPath)
im = Image.fromarray(cv2.cvtColor(im, cv2.COLOR_BGR2RGB))
# switch to BGR, subtract mean
in_ = np.array(im, dtype = np.float32)
in_ = in_[:,:,::-1]
in_ -= np.array((104.00698793,116.66876762,122.67891434))
# make dims C x H x W for Caffe
in_ = in_.transpose((2,0,1))
return in_
fcn_predict.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录