This open-source project is a Micro QR code reader application built using FastAPI and various image processing libraries.
The goal of this application is to provide a high-precision Micro QR code reading service. It leverages advanced image processing techniques to accurately extract information from these small and data-limited QR codes.
Micro QR codes pose unique challenges compared to traditional QR codes due to their significantly smaller size and reduced data capacity. Challenges include accurate edge detection and optical character recognition (OCR) in a constrained space.
- Python 3.x installed on your system.
- Java(https://openjdk.org/) 8+ installed on your system. Tested with 17.x
-
Clone the repository:
git clone https://github.com/isikhi/fast-micro-qr-reader-api.git cd fast-micro-qr-reader-api
-
Install dependencies:
pip install -r requirements.txt
-
Run with default port(8000)
uvicorn app.main:app --reload
-
Clone the repository:
git clone https://github.com/isikhi/fast-micro-qr-reader-api.git cd fast-micro-qr-reader-api
-
Build the Docker image:
docker build -t fast-micro-qr-reader-api .
-
Run the Docker container
docker run -p 8080:8080 fast-micro-qr-reader-api
-
Build and run with Docker Compose(if you want to detach add -d flag to end):
docker run -p 8080:8080 fast-micro-qr-reader-api
- Visit http://127.0.0.1:8000 in your browser to access nothing but see server is up :D
- Make sure to replace /home/isikhi/test/... with the actual paths of your image files and use curl or import to postman
curl --location 'localhost:8080/micro-qrs/decode' \
--form 'files=@"/home/isikhi/test/microqr1.png"' \
--form 'files=@"/home/isikhi/test/microqr2.png"'
- Make sure to replace /home/isikhi/test/... with the actual paths of your image files and use your IDE http tool
POST http://localhost:8080/micro-qrs/decode
Content-Type: multipart/form-data; boundary=--------------------------239061361532539650648925
--------------------------239061361532539650648925
Content-Disposition: form-data; name="files"; filename="/home/isikhi/test/microqr1.png"
Content-Type: image/png
<@/home/isikhi/test/microqr1.png
--------------------------239061361532539650648925
Content-Disposition: form-data; name="files"; filename="/home/isikhi/test/microqr2.png"
Content-Type: image/png
<@/home/isikhi/test/microqr2.png
--------------------------239061361532539650648925--