katanaml / sparrow

Data processing with ML, LLM and Vision LLM
https://katanaml.io
GNU General Public License v3.0
3.73k stars 379 forks source link

How to annotate new document image? #30

Closed pfan-well closed 11 months ago

pfan-well commented 11 months ago

I tried to upload an image but I got this error. It's asking for a corresponding file in docs/json. But I haven't created one because I wish to use the annotation tool to do exactly that. What are the steps to annotate new images?

Screenshot 2023-12-19 at 3 20 19 PM
abaranovskis-redsamurai commented 11 months ago

Hi.

When new image file is uploaded, empty JSON for annotations is automatically created under docs/json. Try to debug function upload_file from data_annotation.py. See line related to "with open(os.path.join("docs/json/", file_name + ".json"), "w") as f:". Check if this file is created on your environment.

Regards, Andrej

pfan-well commented 11 months ago

I see. I put the image in the docs/images first which now I realized is wrong. I uploaded it from the UI then select it in the drop-down menu and it worked. Another question- my document image got cut off in the UI- is there a dimension requirement I should resize it to? Thank you very much.

abaranovskis-redsamurai commented 11 months ago

If you close the menu group sidebar, the image should be correctly displayed - as there will be more horizontal space. Width is calculated in main.py, check option2 for annotation UI. You can adjust the width calculation if it doesn't work for your type of image.