Giter Site home page Giter Site logo

ptyneu / amazon-captcha-solver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hrn-projects/amazon-captcha-solver

0.0 0.0 0.0 36.74 MB

A TensorFlow (Deep Learning - CNN) based solution for tackling captcha when collecting data from Amazon.

License: GNU General Public License v3.0

Python 100.00%

amazon-captcha-solver's Introduction

GPLv3 License PyPi Python Versions

Amazon Captcha Solver

A Flask API based solution for tackling captcha when collecting data from Amazon.

This is a Flask API based solution to solve the captcha, by accepting the captcha image from POST request. The API then calls the captcha solving script and sends the solved captcha text in return.

The goal is to solve the captcha images from Amazon. Sample captcha image can be seen below -

a sample captcha image

How to use :

  1. Run the Flask API script -
python solve_api.py
  1. To check the status of API, call the default method by accessing its IP -
your_api_ip_address:5000    # '5000' being the default port for Flask Server, which hosts the API.
  1. To call the captcha solver function with 'requests' module and passing captcha image as file -
import requests

def captcha_uploader():
    # API URL with a call to function to solve captcha
    captcha_solver_api_url = 'your_api_ip_address:5000/solve'
    # opening the captcha image file as binary and putting it as value for key 'captcha'
    file = {'captcha': open('your_captcha_image_filepath','rb')}
    
    # Calling the API function as a 'POST' request with 'files' parameter
    response = requests.post(captcha_solver_api_url, files=file)
    print("Captcha file uploaded.")

    # Fetching the captcha text from API response.
    try:
        captcha_text = resp.json()['output']
    except:
        print("Response not in JSON format. Please check your API code.")
        captcha_text = "NA"
    
    return captcha_text

How to contribute :

  1. Please start with installing all the required packages from requirements file-
pip install -r requirements.txt
  1. Then to initially run the model on test_captchas, use following command -
python solve_captchas_with_model.py

P.S. Notes :

Regarding model file

The current model file is built after training some 4K training set captcha images. Training can performed on much more larger dataset for better results, but current results aren't bad either ๐Ÿ˜‰.

Regarding API code

The API works fine but can be enhanced further according to use cases. The API's reponses would highly depend upon the training quality of the model file.

amazon-captcha-solver's People

Contributors

hrn-projects avatar dependabot[bot] avatar

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.