Coder Social home page Coder Social logo

azazel0203 / ocr_captcha Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 2.0 42.5 MB

This project creates a basic web service for solving image-based CAPTCHAs. Using the Flask framework, it allows users to upload CAPTCHA images and employs an Optical Character Recognition (OCR) pipeline to extract the embedded text.

Home Page: https://ocr.aadarshkr.me/

License: MIT License

Python 76.23% CSS 13.77% HTML 9.54% Shell 0.11% Dockerfile 0.34%
airflow-dags azure cnn docker dvc flask-application keras mlflow-docker tensorflow

ocr_captcha's Introduction

Typing SVG


GIF



๐Ÿ“– Education

๐Ÿ‘ค About Me

  • ๐ŸŒฑ I'm currently exploring the realms of Machine Learning, Generative AI, and Natural Language Processing.
  • ๐Ÿ”ญ Iโ€™m passionate about leveraging AI to solve real-world problems and create innovative solutions.
  • ๐Ÿ“ซ Feel free to reach out to me at Gmail

๐Ÿ› ๏ธ Skills

  • Programming Languages: Python C++
  • Competitive Programming: Codeforces - Expert
  • Machine Learning: ML and DL Algorithms (GANS, VAEs, CNNs, Neural Networks)
  • Deep Learning: Deep Reinforcement Learning, Artificial Neural Networks
  • Libraries & Frameworks: Python TensorFlow Flask Docker Git GitHub Gemini ChatGPT MLflow Apache Airflow NLP

๐Ÿ–ฅ๏ธ Project Highlights

Machine Learning PyPi Packages
Title Technologies
ocr_captcha TF Docker Azure Keras CNN
Flask DVC Airflow MLflow CI
Sentiment Analyser Static BadgeHugging Face PyTorch Python
Invoice Extractor Gemini-ProLangChain Streamlit
Medical_ChatBot CSS HTML Flask Pinecone Hugging Face
Vector Database Generative AI LangChain Llama2
Title Technologies
mongo_only PyPi MongoDBAtlas
CI MongoDB

๐Ÿ“ˆ Github Stats

๐Ÿ“Š Contributions

github contribution grid snake animation

ocr_captcha's People

Contributors

azazel0203 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ocr_captcha's Issues

error message ['function' object has no attribute 'Model']

Hello!
Please help me start training

All the actions I've taken:

  1. Created a new project (ocr_service) in pycharm with a virtual environment

  2. Cloned the project (git clone https://github.com/Azazel0203/ocr_captcha.git)

  3. cd ocr_captcha

  4. pip install -r requirements.txt

  5. Added six new characters "+", "-", "*", "!", "@", "." to the file "artifact/unique_char.csv", "artifact/char_to_num.json", "artifact/num_to_char.json"

  6. In the file "artifact/char_to_num.json" and "artifact/num_to_char.json" corrected "vocabulary_size": 32 to "vocabulary_size": 38

unique_char.csv file:
Screenshot

This is how I have my files now "artifact/char_to_num.json" and "artifact/num_to_char.json"

{"config": {"name": "string_lookup_1", "trainable": true, "dtype": "float32", "invert": true, "max_tokens": null, "num_oov_indices": 1, "oov_token": "[UNK]", "mask_token": null, "output_mode": "int", "sparse": false, "pad_to_max_tokens": false, "idf_weights": null, "vocabulary": ["[UNK]", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "M", "N", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "+", "-", "*", "!", "@", "."], "vocabulary_size": 38, "encoding": "utf-8"}, "weights": []}
  1. Created a train folder in the {project name}/ocr captcha directory

  2. Added the file "labels.csv" to the train folder
    Screenshot

  3. Created an images folder in the train directory and placed 93 pictures in it
    Screenshot

  4. In the file "data_ingestion.py" I corrected the paths and the cycle
    Screenshot

  5. Manually added the necessary data to the files (I don't know how correct this is) "raw_img_path.csv", "raw_labels.csv", "test_x.csv", "test_y.csv", "train_x.csv", "train_y.csv"

  6. In the file "model_trainer.py" I changed the line with the sizes of the pictures
    Screenshot_1

  7. I run the file "data_ingestion.py", there are no errors

  8. I run the file "model_trainer.py" and get errors

D:\ocr_service\.venv\Scripts\python.exe D:\ocr_service\ocr_captcha\src\ocr_captcha\components\model_trainer.py 
2024-05-07 09:25:38.677735: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-05-07 09:25:39.712543: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-05-07 09:25:41.673057: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
  File "D:\ocr_service\ocr_captcha\src\ocr_captcha\components\model_trainer.py", line 82, in initate_model_training
    model = build_model(self.img_width, self.img_height, char_to_num) 
  File "D:\ocr_service\ocr_captcha\src\ocr_captcha\utils\utils.py", line 178, in build_model
    model = keras.models.Model(
AttributeError: 'function' object has no attribute 'Model'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\ocr_service\ocr_captcha\src\ocr_captcha\components\model_trainer.py", line 129, in <module>
    model_path = trainer.initate_model_training(train_path_x, train_path_y, test_path_x, test_path_y, unique_chars)
  File "D:\ocr_service\ocr_captcha\src\ocr_captcha\components\model_trainer.py", line 119, in initate_model_training
    raise customexception(e, sys)
ocr_captcha.src.ocr_captcha.exception.exception.customexception: Error occured in python script | 
 name [D:\ocr_service\ocr_captcha\src\ocr_captcha\components\model_trainer.py] 
 line number [82] 
 error message ['function' object has no attribute 'Model']

Process finished with exit code 1
  1. In the file "model_trainer.py" line 15 is highlighted as an error
    Screenshot_2

  2. You have written "inference/: Module for making predictions on new images.", there is no such file

What am I doing wrong?
Please help me start training and then test the model.
I would be grateful for any help!
Thank you

Python version 3.10.11
Windows 11 x64
no GPU

How to correctly generate training data?

Hello!
How to correctly generate training data?

Please tell us in more detail what files are needed and what structure
Thank you

P.S. Not all dependencies are installed
P.P.S. labels? How to create them correctly?

ANTIBOT_MODULE_captcha

ANTIBOT_MODULE_captcha

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.