Skip to content
← all work

02 / Computer vision · IoT · Real-time

SmartPark

A parking system that uses one camera instead of a sensor in every spot.

An ESP32-CAM watches the parking lot and YOLOv8 marks each spot as free or taken. Drivers can find, reserve and pay for a spot from their phone. Operators set up a lot by drawing a box over each spot on a live frame.

cam_01 · LIVE
5/8 occupied · 3 freeframe #1042 · 2.0s loop

A simplified version of the operator's live view. Spots are checked every 2 seconds.

Year
2026
Context
Final-year project at Addis Ababa University, built with a teammate
Stack
Next.js · React · TypeScript · Tailwind CSS · FastAPI · Python · PostgreSQL · YOLOv8 · Socket.IO · Docker · ESP32-CAM
mAP@50 on PKLot
0.995
mAP@50 on PKLot
precision and recall
0.999
precision and recall
between detections
2s
between detections
camera per lot
1
camera per lot

The problem

Most smart-parking systems put a sensor under every single spot. That is expensive to install and annoying to maintain. We wanted to know if one overhead camera could do the same job for a whole lot.

What I built

  1. 01A FastAPI background task that grabs a JPEG from the camera every 2 seconds, runs YOLOv8 on it, and matches each detected vehicle to a parking spot using IoU.
  2. 02A YOLOv8s model we trained on the PKLot dataset, with the standard COCO YOLOv8n as a fallback. You switch between them with one environment variable.
  3. 03Live updates to the browser over Socket.IO. If the socket drops, the page falls back to polling every 1.5 seconds.
  4. 04A Next.js PWA for drivers. You can browse stations, see which spots are free, reserve one, and pay through Chapa in Ethiopian Birr.
  5. 05An admin console for operators with the live camera view, a tool for drawing spots on the frame, manual overrides and a daily revenue chart.
  6. 06JWT auth, Alembic migrations and seed data. The whole thing starts with docker compose up.

How a frame flows

  1. 01

    ESP32-CAM

    JPEG every 2 s

  2. 02

    YOLOv8

    car · truck · bus · bike

  3. 03

    IoU mapping

    → calibrated slot boxes

  4. 04

    PostgreSQL

    persist slot state

  5. 05

    Socket.IO

    push + 1.5 s fallback

  6. 06

    Next.js PWA

    live slot grid

The model runs inside the FastAPI service, so there is no separate model server.

The result

One camera covers the whole lot, from the camera frame to a paid reservation. The model we trained on PKLot reached 0.999 precision, 0.999 recall and 0.995 mAP@50.