Archive

YOLO Object Detector

A self-hosted Flask interface for YOLOv8. It accepts file uploads and webcam captures, then streams annotated frames back to the browser.

  • Archive project
  • Public repository
  • Python
  • Flask
  • OpenCV
  • YOLOv8
  • Tailwind
  • WebcamJS

Browser workflows

I built this Flask app to run YOLO detection from a browser. It accepts either an uploaded file or a webcam capture and shows the annotated output on the page.

Flask has separate routes for the home page, webcam and upload modes, streamed detection and webcam image detection. The app stores uploaded files in static/uploads. Webcam captures arrive as base64 data URIs and use the same detection path.

Inference path

The detection code uses OpenCV and an Ultralytics YOLOv8 wrapper, which loads the model and its label file. It opens the input through VideoCapture, scales each frame to bounded dimensions, runs streamed inference, then draws boxes, class labels and confidence values.

Flask streams the result as multipart frames. The interface uses Tailwind and Flowbite, with WebcamJS handling webcam capture.

Scope and repository

The project uses a general-purpose YOLOv8 model. I did not train or tune it; my work covered the browser input, detection and annotated response.

The Flask routes and detector live in separate files in the public repository. ObjectDetector.py loads the model, processes and resizes frames, and draws the annotations.