Kohulan / DECIMER-Image-Segmentation

Chemical structure detection and segmentation tool for Journal articles.
https://decimer.ai
MIT License
81 stars 30 forks source link

Segmentation error on page without structure #95

Closed OBrink closed 11 months ago

OBrink commented 11 months ago

ValueError Traceback (most recent call last) c:\Users\Otto Brinkhaus\OneDrive - Friedrich-Schiller-Universität Jena\Dokumente\Arbeit\testetst\DECIMER-Image-Segmentation\DECIMER_Segmentation_notebook.ipynb Cell 7 line 1 ----> 1 segments = segment_chemical_structures( 2 np.array(pages[0]), expand=True, visualization=True 3 )

File c:\Users\Otto Brinkhaus\OneDrive - Friedrich-Schiller-Universität Jena\Dokumente\Arbeit\testetst\DECIMER-Image-Segmentation\decimer_segmentation\decimer_segmentation.py:101, in segment_chemicalstructures(image, expand, visualization) 99 masks, bboxes, = get_mrcnn_results(image) 100 else: --> 101 masks = get_expanded_masks(image) 103 segments, bboxes = apply_masks(image, masks) 105 if visualization:

File c:\Users\Otto Brinkhaus\OneDrive - Friedrich-Schiller-Universität Jena\Dokumente\Arbeit\testetst\DECIMER-Image-Segmentation\decimer_segmentation\decimer_segmentation.py:230, in get_expandedmasks(image) 228 # Structure detection with MRCNN 229 masks, bboxes, = get_mrcnn_results(image) --> 230 size = determine_depiction_size_with_buffer(bboxes) 231 # Mask expansion 232 expanded_masks = complete_structure_mask( 233 image_array=image, 234 mask_array=masks, 235 max_depiction_size=size, 236 ) ... 83 else: 84 return reduction(axis=axis, out=out, passkwargs) ---> 86 return ufunc.reduce(obj, axis, dtype, out, passkwargs)

ValueError: zero-size array to reduction operation maximum which has no identity