VikParuchuri / surya

OCR, layout analysis, reading order, table recognition in 90+ languages
https://www.datalab.to
GNU General Public License v3.0
14.29k stars 889 forks source link

Output to current directory #214

Open jamesdeluk opened 1 month ago

jamesdeluk commented 1 month ago

Is there a way to output the results.json directly to the current directory?

For example, currently:

C:\ > surya_ocr --results_dir . image.png

saves to C:\image\results.json

Can it simply be C:\results.json?

snowfluke commented 1 month ago

You could chain the command

C:\ > surya_ocr --results_dir . image.png && move image\result.json . && rmdir /s /q image
jamesdeluk commented 1 month ago

The issue is the image isn't actually called image.png, it's a long, complex string (think base64) that changes every time. I guess I could do some kind of Get-ChildItem, save the name to a variable, and do more chaining... But a simple "dump in same folder" option would be very useful 😄