• Stars
    star
    135
  • Rank 269,297 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

High Accuracy Captcha Breaker with Tensorflow and Node.js

Captcha Breaker

Build with Tensorflow (ConvNets) and Node.js πŸ’ͺπŸ’ͺπŸ’ͺ

E.x: Amazon Captcha (click image below to watch demo video)

Amazon Captcha

Installation

Python packages

$ pip install -r requirements.txt

Node.js packages (Node.js user only)

$ npm i

Usage

1. Create train data

Prepare your training dataset

  • Copy captcha images to data/captcha folder
|_data
      |_captcha
          |_ xss7.jpg
          |_ tvu4.jpg

IMPORTANT: Note each image file is named with it's own solution.

That means that if an image is named A1bD3.jpg, it corresponds to a captcha's whose solution is A1bD3

Build train data for model

Run src/create_train_data.py will save your train data as data/captcha.npz compressed file.

$ python src/create_train_data.py

The compressed data/captcha.npz includes:

  • Train Data ( x_train, y_train ): 80%
  • Test Data ( x_test, y_test ): 20%

2. Train

Run src/train.py to train the model with your own dataset.

$ python src/train.py

Take β˜• or 🍡 while waiting!

3. Attack

Now, enjoy your war πŸ”₯πŸ”₯πŸ”₯ 😜😜😜

Python

$ python src/predict --fname YOUR_IMAGE_PATH_or_URL

Sample output:

loading image: data/captcha/captcha_2.jpg
load captcha classifier
predict for 1 char: `X` with probability: 99.956%
predict for 2 char: `I` with probability: 99.909%
predict for 3 char: `N` with probability: 99.556%
predict for 4 char: `C` with probability: 99.853%
predict for 5 char: `H` with probability: 99.949%
predict for 6 char: `A` with probability: 98.889%
Captcha: `XINCHA` with confident: `99.686%`
XINCHA

Node.js

const captchaPredict = require('src/predict')

captchaPredict(YOUR_IMAGE_PATH_or_URL)
  .then(console.log)
  .catch(console.error)

Sample output:

[
  "loading image: data/captcha/captcha_2.jpg",
  "load captcha classifier",
  "predict for 1 char: `X` with probability: 99.956%",
  "predict for 2 char: `I` with probability: 99.909%",
  "predict for 3 char: `N` with probability: 99.556%",
  "predict for 4 char: `C` with probability: 99.853%",
  "predict for 5 char: `H` with probability: 99.949%",
  "predict for 6 char: `A` with probability: 98.889%",
  "Captcha: `XINCHA` with confident: `99.686%`",
  "XINCHA"
]

More Repositories

1

koa-log4js

log4js-node supports Koa-middleware
JavaScript
82
star
2

koa-busboy

Upload files with Busboy
JavaScript
32
star
3

flappybird

Flappy Bird iOS/ Android Clone
Objective-C
26
star
4

jlpt-test

ζ—₯本θͺžθƒ½εŠ›θ©¦ι¨“ JLPTε•ι‘Œι›†
15
star
5

dominhhai.github.io

My Blog
Jupyter Notebook
14
star
6

calculator

Calculator for Nodejs
JavaScript
12
star
7

koa-log4js-example

A full application example which uses koa-log4js
JavaScript
9
star
8

mldl

Learn ML&DL from scratch
Jupyter Notebook
9
star
9

koa-generator

Express liked generator with standard style and gulp-nodemon
JavaScript
8
star
10

aws-training

AWS Training
8
star
11

j2me-engine

A Game Engine for J2ME Platform
Java
8
star
12

awesome-posts

Awesome posts/ articles from Internet
6
star
13

CppDesignPatterns

Design Patterns implement with C++
C++
5
star
14

AndroidOCR

An adaptive Tesseract for Android.
5
star
15

git-u

Quick github command line
JavaScript
4
star
16

jfpe

format-preserving encryption (FPE) by node.js
JavaScript
4
star
17

gitignore

Create `.gitignore` file from any source
JavaScript
4
star
18

licham

Lunar Calendar
JavaScript
3
star
19

rl-intro

Learn RL by the textbook: Reinforcement Learning: An Introduction
Jupyter Notebook
3
star
20

electron-examples

Electron (Atom Shell) Examples
JavaScript
3
star
21

express-oracledb

Oracle DB with ExpressJS
JavaScript
2
star
22

mws-sdk

Amazon MWS client sdk for Node.js with clean output
JavaScript
2
star
23

job-schedule

Schedule job for run a time
JavaScript
2
star
24

K-Means-Clustering

Clustering base on K-Means Algorithm for HTML 5.
JavaScript
1
star
25

blog

Archive Blog
1
star
26

express-authen

Authentication for Expressjs
JavaScript
1
star
27

wedding

Wedding Invitation
HTML
1
star
28

tank90

Convert from J2ME to Android
Java
1
star
29

designpatterntuts

Design Patterns by Java Tutorials
Java
1
star