This repository contains code and resources for a machine learning model that detects, crops, and decodes QR codes from images using a Jupyter Notebook.
QR (Quick Response) codes are two-dimensional barcodes that store various types of information. This project focuses on creating a machine learning model to automatically detect QR codes within images, crop them for better isolation, and decode the information contained in the QR codes.
The repository is organized as follows:
datasets/
: Main dataset used to train the model, with images separated into test, train, and validate folders.datasets 0/
: Previous dataset used to train the model, with images separated into test, train, and validate folders.Images/
: Pre-processed dataset of images with and without QR codes.models/
: Previous models.QR-codes/
: Folder to save cropped QR codes from images.runs/
: Folder containing all previous machine learning models, with the final one located intrain 12/
.QR-detector.ipynb
: Jupyter Notebook containing the code for the project.IMG_20230820_100924_960.jpg
: Image used for manual testing of the model.
- Clone the repository to your local machine:
git clone https:github.comstefano-lacorazza/QR_Code_Detector_Notebook.git
cd QR_Code_Detector_Notebook.
- Upload image you wish to evaluate.
- Open QR_detector.ipynb.
- Change source in cell 9 to your image name.
- Run cell 37, to install packages locally.
- Run cell 9, it will show the detected QR codes.
- Run cell 49, the cropped QR codes will be in the QR-codes directory.
- Run cell 21 to display the decoded url.
- Run cell 22 to see a preview of the website.