A user-friendly studio environment for YOLOPv2 that enables easy model selection, media upload, and real-time camera processing. This tool makes advanced computer vision accessible with an intuitive interface for object detection, lane detection, and drivable area segmentation.
YOLOPv2-Studio provides a web-based interface for the YOLOPv2 model, which performs:
- Object Detection (vehicles, pedestrians, etc.)
- Lane Line Detection
- Drivable Area Segmentation
All within a single unified model optimized for autonomous driving scenarios.
Here are some screenshots showcasing the application's interface and capabilities:
The web interface provides:
-
Multiple Input Methods:
- Upload your own images
- Use the example image from the
data/demo/directory - Use a webcam for real-time detection
-
Customizable Detection Options:
- Toggle object detection, drivable area, and lane detection
- Adjust confidence and IoU thresholds
- Real-time FPS counter for performance monitoring
-
Cross-Platform Compatibility:
- Automatically runs on Windows, macOS, and Linux
- Automatically detects and uses the best available hardware (CPU/GPU)
- Downloads required model files if not available
-
Prerequisites:
- Install Python 3.8 or higher from python.org
- Make sure to check "Add Python to PATH" during installation
-
Installation Steps:
- Open Command Prompt (search for "cmd" in the start menu)
- Run these commands:
:: Clone the repository git clone https://github.com/usamakhangt4/YOLOPv2-Studio.git cd YOLOPv2-Studio :: Create virtual environment python -m venv studio-env studio-env\Scripts\activate :: Install dependencies pip install -r requirements.txt
-
Running the Application:
python -m app.app
or
cd app python app.py -
Open your browser and navigate to: http://localhost:8080
-
Prerequisites:
- Install Python using Homebrew (recommended) or from python.org
- For optimal performance, an Apple Silicon Mac (M1/M2/M3) is recommended
# Install Homebrew if not already installed /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # Install Python brew install python
-
Installation Steps:
- Open Terminal
- Run these commands:
# Clone the repository git clone https://github.com/usamakhangt4/YOLOPv2-Studio.git cd YOLOPv2-Studio # Create virtual environment python3 -m venv studio-env source studio-env/bin/activate # Install dependencies pip install -r requirements.txt
-
Running the Application:
python -m app.app
-
Open your browser and navigate to: http://localhost:8080
Note for Apple Silicon Mac Users: The application will automatically detect Apple Silicon (M1/M2/M3) and use Metal Performance Shaders (MPS) for GPU acceleration! This provides significantly better performance than CPU mode.
-
Prerequisites:
- Most Linux distributions come with Python pre-installed
- If not, install Python using your package manager:
# For Ubuntu/Debian sudo apt update sudo apt install python3 python3-pip python3-venv # For Fedora sudo dnf install python3 python3-pip
-
Installation Steps:
- Open Terminal
- Run these commands:
# Clone the repository git clone https://github.com/usamakhangt4/YOLOPv2-Studio.git cd YOLOPv2-Studio # Create virtual environment python3 -m venv studio-env source studio-env/bin/activate # Install dependencies pip install -r requirements.txt
-
Running the Application:
python -m app.app
-
Open your browser and navigate to: http://localhost:8080
When you run the application for the first time:
-
Automatic Model Download:
- The application will automatically download the YOLOPv2 model if it's not already present
- This might take a few minutes depending on your internet connection
- The model is approximately 150MB in size
-
System Detection:
- The application automatically detects your operating system
- It selects the best device (CPU/GPU) for running the model
- You can view and change these settings via the System Info panel
-
Troubleshooting Common Issues:
-
If the application fails to start:
- Check that you activated the virtual environment
- Ensure all dependencies were installed correctly
-
If the model fails to load:
- Check your internet connection for the automatic download
- You can manually download the model from this link and place it in the
weights/directory
-
If the camera doesn't work:
- Make sure your browser has permission to access your camera
- Try a different browser if issues persist
-
-
Starting the Application:
- Launch the application using the command appropriate for your OS
- Open your web browser and navigate to http://localhost:8080
-
Selecting Input Source:
- Upload Image: Click "Choose File" and select an image from your computer
- Demo Image: Click the "Try Demo Image" button
- Camera: Click "Start Camera" to use your webcam
-
Adjusting Settings:
- Use the toggles to enable/disable detection features
- Adjust the confidence threshold slider to filter detections
- The FPS counter shows real-time performance metrics
-
Working with Results:
- View detection boxes, lane lines, and drivable areas
- For camera mode, click "Start Processing" to begin analysis
- Click "Stop Processing" when done
The application has been refactored for improved organization and performance:
YOLOPv2-Studio/
├── app/ # Application directory
│ ├── static/ # Static assets
│ │ └── js/ # JavaScript files
│ ├── templates/ # HTML templates
│ │ └── index.html # Main application page
│ └── app.py # Main application file with all functionality
├── data/ # Data directory
│ └── demo/ # Demo images and videos
├── utils/ # YOLOPv2 utility functions
│ └── utils.py # Original YOLOPv2 utilities
├── weights/ # Model weights directory
│ └── yolopv2.pt # YOLOPv2 model weights (auto-downloaded)
├── screenshots/ # Application screenshots
├── requirements.txt # Python dependencies
├── LICENSE # License information
└── README.md # This file
The latest version of YOLOPv2-Studio includes several enhancements:
-
Simplified Architecture:
- Centralized application logic in a single app.py file
- Improved Configuration class for all settings
-
Thread Safety:
- Thread-local storage for model state
- Proper resource management for multithreading
-
Enhanced Security:
- Input validation and sanitization
- File type verification
- Protection against malicious uploads
-
Performance Optimizations:
- Smarter image resizing
- Improved memory management
- Metal Performance Shaders (MPS) support for Apple Silicon Macs
- CUDA resource cleanup
-
Platform Detection:
- Automatic device selection (CPU, CUDA, MPS)
- Platform-specific optimizations
- Automatic warm-up for GPU acceleration
-
Environment Variables Support:
- Configure host, port, and debug mode
- Set custom model parameters
You can customize the application behavior using environment variables:
# Server settings
HOST=0.0.0.0 # Host address (default: 0.0.0.0)
PORT=8080 # Port number (default: 8080)
DEBUG=False # Debug mode (default: False)
# Security
SECRET_KEY=mysecretkey # Session secret keyThis project is licensed under the MIT License - see the LICENSE file for details.
- Original YOLOPv2 implementation: CAIC-AD/YOLOPv2
- Inspired by autonomous driving perception systems



