New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error during Line-Segmentation || TypeError: '<' not supported between instances of 'Image' and 'float' #102
Comments
Sorry to hear that the line segmentation isn't working as intended for you once again. |
I hope the XML-file in the "data\processing" folder is what you wanted. |
My text probably was a bit misleading as I only mentioned the XML files but if possible, we'd need the binary / nrm image as well, as both annotations and images are used during line segmentation. |
We sadly couldn't reproduce the error with the attached files but interestingly got an |
We changed parts of the line segmentation implementation and couldn't reproduce the error with that version as well. |
Dear all,
once again I have come up with a problem during line segmentation:
File "/usr/local/lib/python3.6/dist-packages/ocr4all_helpers-0.2.2-py3.6.egg/ocr4all_helpers/pagelineseg.py", line 634, in cli
pool.map(parallel, dataset)
File "/usr/lib/python3.6/multiprocessing/pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/usr/local/lib/python3.6/dist-packages/ocr4all_helpers-0.2.2-py3.6.egg/ocr4all_helpers/pagelineseg.py", line 625, in parallel
remove_images=args.remove_images)
File "/usr/local/lib/python3.6/dist-packages/ocr4all_helpers-0.2.2-py3.6.egg/ocr4all_helpers/pagelineseg.py", line 369, in pagexmllineseg
cropped = Image.fromarray(nlbin.adaptive_binarize(np.array(cropped)).astype(np.uint8))
File "/usr/local/lib/python3.6/dist-packages/ocr4all_helpers-0.2.2-py3.6.egg/ocr4all_helpers/lib/nlbin.py", line 47, in adaptive_binarize
extreme = (np.sum(image<0.05)+np.sum(image>0.95))*1.0/np.prod(image.shape)
TypeError: '<' not supported between instances of 'Image' and 'float'
Is there any further information you need?
Regards,
Leonie
The text was updated successfully, but these errors were encountered: