def decode(self, msg):
fn = os.path.join(self.directory_, msg)
if os.path.exists(fn):
im = cv2.imread(fn,
cv2.CV_LOAD_IMAGE_COLOR if self.color_ \
else cv2.CV_LOAD_IMAGE_GRAYSCALE)
return im_resize(im, shape=self.shape_)
else:
raise Exception('File does not exist')
# Basic type for image annotations
评论列表
文章目录