https://answer-sheet-proceappr-fjcehvmxe5bxopwvfhnkuv.streamlit.app/
python script.py --image "rs_test3.png" --yolo_weights "weights.pt" --crnn_model "best_crnn_model(git).pth"https://colab.research.google.com/drive/1TRqyKe7JmP0dOh4_ijVkAqoEycNRgFWP?usp=sharing
This section details the results obtained using Tesseract OCR for register number extraction.
Initial Accuracy: 58.88% (on 1000 iterations)
Accuracy Improvements:
- Increased Iterations (2000): Accuracy improved to 64.11%.
- Increased Iterations (5000) and Regex Application: Accuracy further improved to 78.88% (regex was applied to the test predictions).
Important Notes on Tesseract Experiments:
- Accuracy Variability: Running the training multiple times resulted in variable accuracy, with a fluctuation of approximately (+-) 1%.
- Overfitting: Increasing the number of iterations beyond 5000 did not lead to further positive improvements in accuracy, suggesting potential overfitting of the Tesseract model to the training data.
This section outlines the results achieved with custom-trained models for register number extraction.
Initial Custom Model Accuracy (without Data Augmentation): 95.14%
Impact of Data Augmentation and Increased Epochs:
- Applying data augmentation and increasing the number of training epochs to 5 resulted in an accuracy of 93%.
Detailed Experiment with "deep CRNN TEMP (with data augmentation).ipynb":
- 70 Epochs: Achieved an accuracy of approximately 91%, with mediocre prediction quality.
- 75 Epochs: Increased the accuracy to around 92.9%, and the prediction quality was observed to be significantly better.
- 80 Epochs: Resulted in a higher accuracy of 94%, but the prediction quality deteriorated, indicating potential overfitting.
Note on Model Saving and Loading:
- Previously, there were issues encountered while saving and loading the trained models. Efforts should be made to ensure the complete and reliable saving of the best-performing model.
Based on the experiments, the following model notebooks appear to be the most promising and should be considered for further development or deployment:
- CRNN with just dropout.ipynb
- deep CRNN TEMP (with data augmentation).ipynb
- Computer: Windows, Linux, or macOS.
- Python: Version 3.8 to 3.13 (we recommend 3.10, but newer ones like 3.12 work too).
- Images: PNG files with 12-digit numbers (e.g.,
21222xxxxxx.png). - GPU (Optional): An NVIDIA graphics card with CUDA 12.1 for faster performance (e.g., RTX 4060).
First, download this project to your computer:
-
Open your terminal (Command Prompt on Windows, Terminal on Mac/Linux).
-
Type this command and press Enter:
git clone https://github.com/SANTHAN-KUMAR/Register-Number-Extraction
cd Register-Number-ExtractionWe’ll create a “virtual environment” to keep things organized:
- Run this command:
python -m venv env- Activate it :
env\Scripts\activateThis project needs some Python libraries. Pick the option below based on your setup:
If you don’t have an NVIDIA GPU or just want to keep it simple:
- Run :
pip install -r requirements.txt- Check if it worked :
python -c "import torch; print('PyTorch version:', torch.__version__); print('GPU available?', torch.cuda.is_available())"It should output something like this :
PyTorch version: 2.5.1
GPU available? False
If you have an NVIDIA GPU with CUDA 12.1 (like the RTX Series):
- Check your CUDA version:
nvcc --versionLook for “release 12.1” (e.g., Cuda compilation tools, release 12.1, V12.1.105). If it’s different (e.g., 11.8), see the “Other GPUs” note below.
- Install the GPU version:
pip install torch==2.5.1+cu121 torchvision==0.20.1+cu121 -f https://download.pytorch.org/whl/torch_stable.html
pip install numpy>=1.26.0 pillow>=10.1.0- Check if it worked:
python -c "import torch; print('PyTorch version:', torch.__version__); print('GPU available?', torch.cuda.is_available())"You should see :
PyTorch version: 2.5.1+cu121
GPU available? True
pip install torch==2.5.1+cu118 torchvision==0.20.1+cu118 -f https://download.pytorch.org/whl/torch_stable.html
pip install numpy>=1.26.0 pillow>=10.1.0Find your version at PyTorch’s site.
1.Start Jupyter Notebook:
jupyter notebook