Computer Vision System

Python

Real-time object detection and image classification system

Tech Stack

Python 3.12
PyTorch
OpenCV
YOLOv8
FastAPI

Features

Object detection with YOLOv8
Image classification
Real-time video processing
REST API for predictions
Batch processing support

Code Sample

detector.py
from ultralytics import YOLO
import cv2

class ObjectDetector:
    def __init__(self, model_path: str = "yolov8n.pt"):
        self.model = YOLO(model_path)

    def detect(self, image_path: str):
        results = self.model(image_path)
        detections = []
        for result in results:
            for box in result.boxes:
                detections.append({
                    "class": result.names[int(box.cls)],
                    "confidence": float(box.conf),
                    "bbox": box.xyxy.tolist()
                })
        return detections
View Source Docker Hub Live Demo