Edge computing · Computer vision · IoT
Parqo
An edge-first smart parking system that recognises Nigerian licence plates, makes access decisions locally, and synchronises parking activity with the cloud when connectivity is available.
TypeScript / Python / FastAPI / NestJS / Next.js / Expo / PostgreSQL / SQLite / MQTT / ONNX Runtime / YOLOv8 / RapidOCR / ESP32
Parqo began with a practical question: can a low-cost, CPU-based system recognise Nigerian licence plates quickly enough for access control while continuing to operate during temporary network disruption?
Most automated parking systems assume that a reliable internet connection is always available. That becomes risky at a physical gate: network delays can slow entry, while an outage can prevent an authorised vehicle from being validated.
Parqo uses a different system boundary. Time-sensitive recognition and authorisation stay at the parking facility, while the cloud handles reservations, administration, reporting, and long-term persistence.
What I built
The prototype is composed of six cooperating parts:
- An ESP32-CAM gate node for vehicle detection, image capture, and barrier control.
- A FastAPI vision service that detects licence plates and performs OCR locally.
- An SQLite-backed edge decision service that validates recognised vehicles without requiring a cloud request.
- A NestJS cloud API for reservations, users, parking sessions, and administration.
- A Next.js management dashboard for parking activity and system status.
- An Expo mobile application for vehicle management, reservations, and session updates.
MQTT connects the hardware and local services. Gate events are stored locally and later synchronised with the PostgreSQL cloud database. WebSockets deliver real-time updates to the dashboard and mobile application.
Entry follows a fail-secure policy. Exit follows a fail-open policy so that recognition or connectivity failures cannot trap a vehicle inside the facility.
Designing the recognition pipeline
I trained a compact YOLOv8n model specifically for Nigerian licence-plate localisation. The audited dataset contained 1,797 annotated images: 1,497 for training, 200 for validation, and 100 for detector testing.
The model was trained for 50 epochs using transfer learning and image augmentation. I exported the selected checkpoint to ONNX so that the deployed vision service could run inference through ONNX Runtime without depending on a GPU.
The final pipeline combines:
- YOLOv8n plate localisation.
- Aspect-ratio-preserving letterbox preprocessing.
- Multiple OCR views, including original and contrast-enhanced crops.
- RapidOCR character recognition.
- Nigerian plate-format ranking and conservative character correction.
- Confidence thresholds before an output can reach the authorisation service.
Restoring YOLO-compatible letterboxing was an important engineering finding. It increased deployment-path validation mAP@0.5:0.95 from 0.8480 to 0.8851, bringing the exported ONNX implementation close to the 0.8889 result recorded during training.
Evaluation methodology
I evaluated localisation and complete plate recognition separately. The exported detector was tested on all 100 images in the untouched detector test split. The end-to-end ALPR pipeline was then evaluated on 98 independently labelled images.
Before the end-to-end evaluation, I compared the evaluation images with the training and validation sets using SHA-256 and perceptual hashes. Exact and probable overlaps were removed so that training leakage would not inflate the reported results.
The evaluation measured plate localisation, successful plate reads, exact matches, mean string similarity, OCR confidence, and end-to-end access-decision behaviour. This distinction mattered because a plate can be localised correctly while its characters are still transcribed incorrectly.
Results
On the 100-image held-out detector test split, the exported ONNX model achieved:
- 100% precision and recall at IoU 0.50
- 1.0000 mAP@0.5
- 0.8484 mAP@0.5:0.95
- 0.9131 mean matched IoU
On the leakage-audited 98-image end-to-end evaluation set, the system achieved:
- 100% plate localisation
- 100% successful plate reads
- 86.73% exact matches — 85 of 98 plates
- 97.49% mean string similarity
- 95.11% mean accepted OCR confidence
The OCR refinements increased exact-match accuracy from 77.55% to 86.73%, while mean string similarity improved from 91.65% to 97.49%.
The remaining 13 errors were not localisation failures. They primarily involved single-character substitutions, omitted prefixes, and non-standard or government plate layouts. At that point, Nigerian plate-specific OCR had become the pipeline's main limitation.
Edge-first findings
Five controlled integration scenarios exercised authorised entry, expired-reservation denial, unauthorised entry, exit processing, and a local-cache miss followed by cloud fallback. Each scenario produced the expected gate decision.
Four local-cache cases completed in approximately 347–543 milliseconds. The successful cloud-fallback case required 3,268 milliseconds. The sample is too small to support a general latency multiplier, but it demonstrates the architectural value of local validation: the time-sensitive workflow does not have to wait for a remote database or stable internet connection.
When connectivity returns, Parqo synchronises buffered events and reconciles local and cloud state.
What the project demonstrated
Parqo showed that a complete parking workflow—recognition, authorisation, gate control, occupancy monitoring, and cloud synchronisation—can be coordinated using affordable hardware and CPU-based inference.
More importantly, the project treated ALPR as one component of a larger operational system. Recognition confidence, local state, reservation validity, gate-safety policies, and eventual consistency all influence whether a vehicle should be admitted.
The result is a functional research prototype rather than a production deployment. Its controlled evaluation establishes feasibility while leaving important questions for field testing.
Limitations and next steps
The ALPR evaluation used static images under controlled conditions, and the integration latency findings came from only five functional scenarios. The prototype has not been evaluated over sustained outdoor operation, night-time traffic, adverse weather, or a large number of real gate transactions.
The next stage would use ordinary IP cameras, a production boom barrier, and safety sensors at a real institutional parking facility. Multi-frame recognition, additional Nigerian plate data, and specialised handling for government and non-standard plates would be evaluated against the current single-image baseline.


