Closed hiyashi-CianDuo closed 1 year ago
Dear Hiyashi,
Can you please share your input image?
Hello vahidrezanezhad, Thanks for your reply
This is the input image:
and I use this command and get the this image inforation $identify 179681.jpg 179681.jpg JPEG 392x294 392x294+0+0 8-bit sRGB 52.6KB 0.000u 0:00.000
Dear Hiyashi,
I have just checked this image and sbb_biarize goes through smoothly. Please update and double-check your command. I will put the binarized image here.
Hello vahidrezanezhad, Thanks for your reply I want to ask you Is the format of the command I entered correctly? "sbb_binarize --patches -m ./models/model_bin_sbb_ens.h5 179681.jpg img.jpg"
oh I have just spotted the problem. You don't need to specify the model name. Just the directory where the model is.
It should be like this "sbb_binarize --patches -m ./models 179681.jpg img.jpg"
If you have multiple models in the directory, sbb_binarize would use all of them. Be careful that for the latest version you need only this model "model_bin_sbb_ens.h5"
Hello vahidrezanezhad, thanks for your help I know the cause of the problem and it has been resolved The cause of the problem is the path setting of the model The model must be placed in the sbb_binarization folder instead of the models folder thank you very much
Hello vahidrezanezhad, If I want to use usb_camera or a lot of pictures, how can I use it?
Does it mean you wanna flow images into sbb_binarize from a list of images? sth like this?
Yes it should be the same way
Dear Hiyashami,
you can use this script to flow all your files
https://github.com/vahidrezanezhad/sbb_binarize_flow_from_directory
Hello vahidrezanezhad, thanks for your help Sorry to reply to you late, The solution you provided works normally I have some questions to ask you, It takes 10-19 seconds to run an image, Is this the time it would take for the original design of the program? Is there no way to run it in real-time?
Are you running on GPU or CPU? by the way our tools binarize in small patches and then all patches merged as the final image. So you can imagine that if you have a bigger image, namely more patches is needed, then sbb_binarize needs more time to do the job.
On Wed, May 26, 2021 at 11:25 PM hiyashi-CianDuo @.***> wrote:
Hello vahidrezanezhad, thanks for your help Sorry to reply to you late, The solution you provided works normally I have some questions to ask you, It takes 10-19 seconds to run an image, Is this the time it would take for the original design of the program? Is there no way to run it in real-time?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/qurator-spk/sbb_binarization/issues/30#issuecomment-849289426, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIWJ5SKII6BL7N7RII5N7TTPW3RFANCNFSM45NKMGWQ .
Note: this also happens in the OCR-D interface, if you use the wrong model name. I think there should be a proper exception during init for this.
I think there should be a proper exception during init for this
I agree!
Thanks @vahidrezanezhad.
@kba I will leave this issue open until we have added a similar construct to ocrd_cli.py
https://github.com/qurator-spk/sbb_binarization/issues/30#issue-899709182
I got the same question with you,the model cannot find correctly,
as follow,you said that:
""The cause of the problem is the path setting of the model
The model must be placed in the sbb_binarization folder instead of the models folder""
please tell me which folder ? maybe I can't find sbb_binarization folder, I have tried many times.
I got the same question with you,the model cannot find correctly, as follow,you said that: ""The cause of the problem is the path setting of the model The model must be placed in the sbb_binarization folder instead of the models folder""
please tell me which folder ? maybe I can't find sbb_binarization folder, I have tried many times.
could you please share your command and the error?
@vahidrezanezhad
(base)ps@amax:~/sbb_binarization-master$ ls
build LICENSE models requirements.txt
CHANGELOG.md Makefile ocrd-tool.json sbb_binarization.egg-info
dist make.sh README.md sbb_binarize
IMG_20220114_134650.jpg model_bin_sbb_ens.h5 repo setup.py
(base)ps@amax:~/sbb_binarization-master$ sbb_binarize --patches -m ./models/ ./IMG_20220114_134650.jpg ./img.jpg
Traceback (most recent call last):
File "/data/ps/miniconda3/bin/sbb_binarize", line 8, in
the command and the error as blow.
Looks like I have the same issue.
The model is model/model/model_bin_sbb_ens.h5
run on Mac no GPU
sbb_binarize --patches -m ./model/ 1.jpg 2.jpg
Traceback (most recent call last):
File "/Users/daniel/dev/sbb_binarization/venv/bin/sbb_binarize", line 33, in
Hello I trying to use image input "sbb_binarize --patches -m ./models/model_bin_sbb_ens.h5 179681.png img.png"
I get the following error " File "/home/lin/anaconda3/bin/sbb_binarize", line 8, in
sys.exit(main())
File "/home/lin/anaconda3/lib/python3.5/site-packages/click/core.py", line 829, in call
return self.main(args, kwargs)
File "/home/lin/anaconda3/lib/python3.5/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/lin/anaconda3/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/home/lin/anaconda3/lib/python3.5/site-packages/click/core.py", line 610, in invoke
return callback(args, **kwargs)
File "/home/lin/anaconda3/lib/python3.5/site-packages/sbb_binarize/cli.py", line 16, in main
SbbBinarizer(model_dir).run(image_path=input_image, use_patches=patches, save=output_image)
File "/home/lin/anaconda3/lib/python3.5/site-packages/sbb_binarize/sbb_binarize.py", line 265, in run
img_last[:, :][img_last[:, :] > 0] = 255
TypeError: 'int' object is not subscriptable"