Giter Site home page Giter Site logo

dahoam2017's Introduction

Tensorflow Captcha Solver

Solve image based captchas using Tensorflow neural networks. This demo was developed for the DAHO.AM Conference in Munich, 2017.

Getting started

Clone the repository:

$ git clone https://github.com/KarimJedda/dahoam2017.git

This guide was written for Mac users, but users might still find it useful.

Set up Python virtualenv

Create a new virtual environment:

$ virtualenv dahoam

Activate the virtual environment:

$ source dahoam/bin/activate

Check if the Python virtual environment is set up correctly:

$ which python
/Users/your-username/Development/dahoam2017/env/bin/python

Install dependencies:

$ pip install -r requirements.txt

Troubleshooting: Tensorflow could not be found:

Could not find a version that satisfies the requirement tensorflow==1.1.0 (from -r requirements.txt (line 51)) (from versions: )
No matching distribution found for tensorflow==1.1.0 (from -r requirements.txt (line 51))

If you encounter this error, try installing Tensorflow from the binary:

$ python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.1.0-py2-none-any.whl

Linux or Windows users need to find another download link...

Generate captchas

Go to captchas folder:

$ cd captchas

Download SimpleCaptcha to the folder:

$ curl -O https://vorboss.dl.sourceforge.net/project/simplecaptcha/simplecaptcha-1.2-jdk1.5.jar

Extract SimpleCaptcha:

$ jar xf simplecaptcha-1.2-jsd1.5.jar

Run SimpleCaptcha:

$ javac Main.java && java Main

Train the neural network

Once you've generated the test data, go to the solver folder:

$ cd solver

Create the tensorflow records:

$ python captcha_records.py 

Train the network (Note, that the training runs until you stop it):

$ python captcha_train.py 

Evaluate the performance of the network:

$ python captcha_eval.py

Try to solve some captchas:

$ python captcha_predict.py

Everything working? Great! Go solve some captchas (on your own machine for developing purposes, 'f course).

Further info

If you want to see how a neural network is working, check out Tenserflow Graph Viz.

dahoam2017's People

Contributors

karimjedda avatar stekhn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dahoam2017's Issues

How should we use captcha_eval.py

Hello,

The captcha_record.py seems to work perfectly fine.
However, how can I evaluate it ? I mean, if I launch captcha_eval.py after stopping captcha_record.py, I just get a lot 0 precision as my computer doesn't remember the training.
How are we supposed to use it ?

Thanks in advance for your help

Is there any report or paper that you have made for this?

Is there any publication (report or paper) that you have made for this? It would be helpful. Im doing research on this topic (Captcha and Deep Learning [Tensorflow]). If you have done any paper or report I will refer to your that paper or report berfore doing something on this topic.

captcha_records.py not working?

Hey,

I wrote you on FB messenger the same, I'm trying to use your library, I set up virtualenv, installed dependencies, generated captchas, etc, didn't change any source, but when I launch $ python captcha_records.py, I get this crash:

Looking for images in './data/train_data'
>> Writing ./data/train.tfrecords
Traceback (most recent call last):
  File "captcha_records.py", line 123, in <module>
    tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
  File "/Users/gintas/Downloads/dahoam2017-master/dahoam/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "captcha_records.py", line 102, in main
    conver_to_tfrecords(training_data, TRAIN_FILE)
  File "captcha_records.py", line 62, in conver_to_tfrecords
    label_raw = label_to_one_hot(label).tostring()
  File "captcha_records.py", line 42, in label_to_one_hot
    index.append(CHAR_SETS.index(c))
ValueError: substring not found

you said it might be because captcha generator isn't generating ans.txt or something, but looking at the source code it this repository, it means that this source isn't finished? Would you be able to commit the changes you have?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.