/data/py/origami/bbz-segment/02_preprocessing$ python main.py
out_bin_path/data/py/origami/00_demo_data/corpus/0000/bin/2436020X_1918-12-10_64_578_006.png
896x1280: 0%| | 0/1 [00:00<?, ?it/s][[ 1 -1 -1 -1]
[ 2 0 -1 -1]
[ 3 1 -1 -1]
[ 4 2 -1 -1]
[ 5 3 -1 -1]
[ 6 4 -1 -1]
[ 7 5 -1 -1]
[ 8 6 -1 -1]
[ 9 7 -1 -1]
[10 8 -1 -1]
[11 9 -1 -1]
[12 10 -1 -1]
[13 11 -1 -1]
[14 12 -1 -1]
[-1 13 -1 -1]]
error on generating data for /data/py/origami/00_demo_data/corpus/0000/ann/2436020X_1918-12-10_64_578_006.psd
896x1280: 0%| | 0/1 [00:03<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 480, in
p.gen()
File "main.py", line 464, in gen
create_training_data((896, 1280), (896, 384))
File "main.py", line 445, in create_training_data
self._gen_train(inputs, codes_name, codes_mapping, full_size, tile_size)
File "main.py", line 405, in _gen_train
converter(gt_ref)
File "main.py", line 259, in call
augmentation)
File "main.py", line 293, in _psd
ground_truth = gt_ref.load(self._logger)
File "/data/py/origami/bbz-segment/02_preprocessing/preprocessing/gt.py", line 248, in load
return GroundTruthRef._loader(self, self.annotated_path, self.document_path, logger)
File "/data/py/origami/bbz-segment/02_preprocessing/preprocessing/gt.py", line 231, in call
gt.add_labels("regions", self._generate_regions(gt))
File "/data/py/origami/bbz-segment/02_preprocessing/preprocessing/gt.py", line 172, in _generate_regions
regions = annotations.regions()
File "/data/py/origami/bbz-segment/02_preprocessing/preprocessing/labels.py", line 471, in regions
return Regions(self.clabels, segments)
File "/data/py/origami/bbz-segment/02_preprocessing/preprocessing/labels.py", line 819, in init
self._tables = morpholizer.table_polygons()
File "/data/py/origami/bbz-segment/02_preprocessing/preprocessing/labels.py", line 1177, in table_polygons
micro_regions, macro_regions = self._table_regions_at_iterations(kernel, (2, 5))
File "/data/py/origami/bbz-segment/02_preprocessing/preprocessing/labels.py", line 1166, in _table_regions_at_iterations
results.append(_regions_to_convex_hull(table_mask).astype(numpy.uint8))
File "/data/py/origami/bbz-segment/02_preprocessing/preprocessing/labels.py", line 486, in _regions_to_convex_hull
polygons = mask_to_polygons(mask, convex_hulls=True)
File "/data/py/origami/bbz-segment/02_preprocessing/preprocessing/utils/init.py", line 90, in mask_to_polygons
return mask_to_contours(mask, cls=shapely.geometry.Polygon, **kwargs)
File "/data/py/origami/bbz-segment/02_preprocessing/preprocessing/utils/init.py", line 57, in mask_to_contours
hull = cv2.convexHull(c, returnPoints=False)
cv2.error: OpenCV(4.5.3) /tmp/pip-req-build-l1r0y34w/opencv/modules/imgproc/src/convhull.cpp:143: error: (-215:Assertion failed) total >= 0 && (depth == CV_32F || depth == CV_32S) in function 'convexHull'