Open kofoednielsen opened 3 years ago
Hi kofoednielsen,
PNG is hardcoded since AOCR only supports PNG and not JPG.
The labelling script supports labelling JPG files, but they still need to be converted to PNG before uploading to the server. I haven't gotten around to adding this conversion function to the labeller script.
In the mean time, you can use something like this to convert all your images to PNG for uploading:
import glob
import cv2
img_dir = "<Add image dir>"
output_dir = "<Add output dir>"
imgs = glob.glob(img_dir + "/*.jpg")
for img in imgs:
cv2.imwrite(img.replace(img_dir, output_dir + "/").replace("jpg","png"), cv2.imread(img))
This is usually the small script I use for conversion, but I'd like to integrate it into the labelling script to already convert images to PNG.
You can also do it with a simple imagemagick
command: mogrify -format png *.jpg
Just wanted to let you know, as others might run into the same problem.
Hi kofoednielsen,
Apologies for the late response but I've been busy at work.
Yes, command line tools can also be used to solve this problem. However I want to code a converter into the labelling script already.
I've reopened the issue and will close it once I get around to releasing the new version with the above update added.
If i run
captcha22 client label --image-type jpg
, and give the genreated zip file to the engine. I get this errorLikely because you have .png hardcoded here: https://github.com/FSecureLABS/captcha22/blob/f5e2662f64cbb4d2606982a1b1d0a449a081631f/captcha22/lib/server/captcha22.py#L60