Skip to content

sourabhligade/dominant_color

Repository files navigation

Object Detection with YOLOv8 in Django

This project is a Django-based web application for object detection using the YOLOv8 model. The application allows users to upload images and videos, perform object detection, and display the results with bounding boxes and labels.

Upload an Image Screenshot 2024-07-21 at 11 42 08 PM

Check out the detections Screenshot 2024-07-21 at 11 42 25 PM

Shows Colors of the detected objects and other filters Screenshot 2024-07-21 at 11 42 32 PM

Check out confidence levels Screenshot 2024-07-21 at 11 42 29 PM

Features

  • Image and video upload
  • Object detection using YOLOv8
  • Display detected objects with bounding boxes and labels
  • Display dominant colors and color names for detected objects
  • Save and display the results

Prerequisites

  • Python 3.x
  • Django
  • OpenCV
  • NumPy
  • Pandas
  • UltraLytics YOLO

Installation

  1. Clone the repository:

    git clone https://github.com/sourabhligade/dominant_color.git
    cd yolo-django-object-detection
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the required packages:

    pip install -r requirements.txt
  4. Apply migrations:

    python manage.py migrate
  5. Run the Django development server:

    python manage.py runserver

Usage

Uploading an Image

  1. Navigate to http://127.0.0.1:8000/upload-image/ in your web browser.
  2. Use the form to upload an image file.
  3. Click the "Upload" button.
  4. The object detection results will be displayed, including bounding boxes and labels.

Uploading a Video

  1. Navigate to http://127.0.0.1:8000/upload-video/ in your web browser.
  2. Use the form to upload a video file.
  3. Click the "Upload" button.
  4. The object detection results will be displayed for each frame of the video.