poke1024 / bbz-segment

Code and data for the paper at http://arxiv.org/abs/2004.07317
GNU General Public License v2.0
16 stars 5 forks source link

Problem when 02_preprocessing #6

Open uuleaf opened 3 years ago

uuleaf commented 3 years ago

/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'

uuleaf commented 3 years ago

Package Version


absl-py 0.13.0 aggdraw 1.3.12 aiohttp 3.6.2 aiomysql 0.0.20 astor 0.8.1 astunparse 1.6.3 async-timeout 3.0.1 asyncio 3.4.3 atomicwrites 1.4.0 attr 0.3.1 attrs 21.2.0 blinker 1.4 brotlipy 0.7.0 cached-property 1.5.2 cachetools 4.2.2 cairocffi 1.2.0 calamari-ocr 1.0.5 certifi 2021.5.30 cffi 1.14.6 chardet 3.0.4 click 8.0.1 coremltools 4.1 coverage 5.5 cppimport 21.3.7 cryptography 3.4.7 cssselect 1.1.0 cycler 0.10.0 Cython 0.29.24 dataclasses 0.6 docopt 0.6.2 edit-distance 1.0.4 efficientnet 1.0.0 flatbuffers 20210226132247 future 0.18.2 gast 0.2.2 google-auth 1.33.0 google-auth-oauthlib 0.4.1 google-pasta 0.2.0 greenlet 1.1.0 grpcio 1.36.1 h5py 2.10.0 humanize 3.10.0 idna 2.10 image-classifiers 1.0.0 imageio 2.9.0 importlib-metadata 3.10.0 intervaltree 3.1.0 jieba 0.42.1 Jinja2 3.0.1 joblib 1.0.1 jsonschema 3.2.0 Keras 2.3.1 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.2 kiwisolver 1.3.1 kraken 3.0.2 llvmlite 0.36.0 lxml 4.6.3 Mako 1.1.4 Markdown 3.3.4 MarkupSafe 2.0.1 matplotlib 3.3.4 mkl-fft 1.3.0 mkl-random 1.2.2 mkl-service 2.4.0 mpmath 1.2.1 multidict 4.7.6 networkx 2.6.1 numba 0.53.1 numpy 1.19.1 oauthlib 3.1.1 olefile 0.46 opencv-python 4.5.3.56 opt-einsum 3.3.0 packaging 21.0 pandas 1.2.5 Pillow 8.3.1 pip 21.1.3 portalocker 2.3.0 portion 2.1.6 prettytable 2.1.0 protobuf 3.14.0 psd-tools 1.9.17 psutil 5.8.0 pyasn1 0.4.8 pyasn1-modules 0.2.8 pybind11 2.7.0 pycairo 1.20.1 pycparser 2.20 PyJWT 2.1.0 PyMySQL 0.9.2 pyOpenSSL 20.0.1 pyparsing 2.4.7 pypng 0.0.20 PyQt5 5.12.3 PyQt5-sip 4.19.18 PyQtChart 5.12 PyQtWebEngine 5.12.1 pyrsistent 0.18.0 PySide2 5.15.2 PySocks 1.7.1 python-bidi 0.4.2 python-dateutil 2.8.2 pytz 2021.1 pyvips 2.1.15 pyvoronoi 1.0.5 PyWavelets 1.1.1 PyYAML 5.4.1 regex 2021.7.6 requests 2.25.1 requests-oauthlib 1.3.0 rsa 4.7.2 Rtree 0.9.7 scikit-image 0.17.2 scikit-learn 0.24.2 scipy 1.6.2 segmentation-models 1.0.1 semantic-version 2.8.5 setuptools 52.0.0.post20210125 Shapely 1.7.1 shiboken2 5.15.2 six 1.16.0 skgeom 0.1.2 sortedcontainers 2.4.0 SQLAlchemy 1.4.21 sympy 1.8 tabulate 0.8.9 tensorboard 1.15.0 tensorboard-plugin-wit 1.6.0 tensorflow 1.15.2 tensorflow-estimator 1.15.1 tensorflow-gpu 1.15.2 termcolor 1.1.0 tesserocr 2.5.2 threadpoolctl 2.2.0 tifffile 2021.7.2 torch 1.7.0 torchvision 0.8.1 tornado 6.1 tqdm 4.61.2 typing-extensions 3.10.0.0 urllib3 1.26.6 wcwidth 0.2.5 Werkzeug 1.0.1 wheel 0.34.2 wquantiles 0.6 wrapt 1.12.1 xlrd 2.0.1 XlsxWriter 1.4.4 yarl 1.4.2 zipp 3.5.0