This project provides two intuitive interfaces to detect and decode QR codes and Data Matrix codes:
- 🌐 A modern Flask-based web application
- 🖥️ A desktop GUI application built with Tkinter
- 🔍 Detects QR codes and Data Matrix codes in images
- 🧠 Utilizes YOLOv8 for robust and accurate detection
- 🖼️ Handles multiple codes per image
- 🧩 Displays decoded data with visual overlays
- 🌐 Web app supports drag-and-drop uploads
- 🖱️ Desktop app supports file selection dialog
- 📋 One-click copy of decoded content
- 🧪 Pre-packaged with sample images for testing
- Python 3.8+
pip
package manager
-
Clone the repository:
git clone https://github.com/Lamouchi-Bayrem/Data-Matrix-scanner.git cd Data-Matrix-scanner
-
Install dependencies:
pip install -r requirements.txt
-
Download the YOLO model weights:
- Place
best.pt
in the root directory.
- Place
python app.py
Access it at: http://localhost:5000
- Open the web interface in your browser
- Drag and drop an image or click to select
- View decoded codes with bounding boxes
- Copy results to clipboard
web-app/
├── app.py # Flask backend
├── requirements.txt # Web dependencies
├── best.pt # YOLOv8 model weights
├── uploads/ # Uploaded images
└── templates/
└── index.html # Web interface
python tkinter_app.py
- Launch the GUI
- Click "Open Image" to choose a file
- View decoded codes and visual highlights
- Save or copy results
desktop-app/
├── tkinter_app.py # Desktop GUI
├── requirements.txt # GUI dependencies
├── best.pt # YOLOv8 model weights
└── samples/ # Example test images
- ⏱️ Average processing time: 500–1500 ms per image (depending on hardware)
- 📐 Recommended image size: 800–2000px per side
- 🖼️ Supported formats: PNG, JPG, JPEG, BMP
- Ensure the image has good lighting
- Try a higher resolution image
- Lower the confidence threshold if needed
- Verify Python version (3.8+)
- If using GPU, ensure CUDA is configured correctly
This project is licensed under the MIT License – see the LICENSE file for details.