Skip to content
This repository was archived by the owner on Feb 22, 2020. It is now read-only.

Commit a7b12cb

Browse files
committed
refactor(preprocessor): add gif chunk prep
1 parent b9fdb41 commit a7b12cb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

gnes/preprocessor/image/segmentation.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,14 @@ def apply(self, doc: 'gnes_pb2.Document'):
8181
else:
8282
self.logger.error('bad document: "raw_bytes" is empty!')
8383

84-
def _crop(self, original_image, coordinates):
85-
return np.array(original_image.crop(coordinates))
86-
8784
def _get_seg_offset_nd(self, all_subareas: List[List[int]], index: List[List[int]], chunk: List[int]) -> List[int]:
8885
iou_list = [self._cal_iou(area, chunk) for area in all_subareas]
8986
return index[int(np.argmax(iou_list))][:2]
9087

88+
@staticmethod
89+
def _crop(original_image, coordinates):
90+
return np.array(original_image.crop(coordinates))
91+
9192
@staticmethod
9293
def _cal_area(coordinate: List[int]):
9394
return (coordinate[2] - coordinate[0]) * (coordinate[3] - coordinate[1])

0 commit comments

Comments
 (0)