Open AnnaYanami-8 opened 3 months ago
It's odd for the y_max is usually larger than y_min. If a text is very small indeed(pixel level), the detection model may fail to detect it.
Anyway, there is a trick to handle this error, which is changing line 299 to:
draw.rectangle([x_min, y_min, x_max+1, y_max+1], fill=None, outline=color_palette[label], width=1)
Could you please send a picture of visualization pdf that contains this small bbox, we may consider fixing this situation in the next version.
Traceback (most recent call last): File "/home/dell/yangyudong/PDF-Extract-Kit/pdf_extract.py", line 229, in
draw.rectangle([x_min, y_min, x_max, y_max], fill=None, outline=color_palette[label], width=1)
File "/home/dell/anaconda3/envs/pipeline/lib/python3.10/site-packages/PIL/ImageDraw.py", line 413, in rectangle
self.draw.draw_rectangle(xy, ink, 0, width)
ValueError: y1 must be greater than or equal to y0