JackonYang / captcha-tensorflow

Image Captcha Solving Using TensorFlow and CNN Model. Accuracy 90%+
MIT License
996 stars 272 forks source link

How to test using a single image #40

Open WilliamSMendes opened 2 years ago

WilliamSMendes commented 2 years ago

Hey, i found this code and it's amazing, thanks for all! I have a issue... how to pass a single captcha per time? In the example you pass a batch.

plus issue: how can i gerenate a black and white captcha? In this case you pass the number 3 on the argument C (RGB), i need to generate more collored type of captchas.

snowfluke commented 2 years ago

For the black and white captcha I think you need to process the image generated to be grayscaled using PIL

from PIL import Image

img = Image.open('captcha.png').convert('L')
img.save('captcha-blackwhite.png')

If you want to pass one image you can refer to this notebook https://github.com/JackonYang/captcha-tensorflow/blob/master/captcha-solver-model-restore.ipynb