HaulVision Banner

πŸš› HaulVision

AI-Powered Truck Detection β€’ Real-Time β€’ Highway & Logistics Optimized

HuggingFace YOLO Streamlit Python License

A production-grade Streamlit application built around a fine-tuned YOLO object detection model optimized for real-time truck identification, achieving high precision across dense highway and logistics environments.


✨ Features

Feature Description
πŸ“· Image Detection Upload images (JPG, PNG, BMP, WEBP) for instant truck detection
🎬 Video Detection Process videos (MP4, AVI, MOV, MKV, WMV) frame-by-frame with progress tracking
⚑ Real-Time Inference Fast YOLO-based detection with GPU acceleration support
🎯 Adjustable Thresholds Fine-tune confidence & NMS IoU via interactive sliders
πŸ“Š Rich Analytics Detection counts, confidence distribution, class breakdown, inference timing
🎨 Custom Bounding Boxes Color-coded boxes with corner accents, semi-transparent fills, confidence labels
⬇️ Export Results Download annotated images (PNG) and videos (MP4)
πŸ€— HF Model Hosting Model auto-downloaded from Hugging Face Hub with caching
πŸŒ™ Premium Dark UI Gradient headers, glassmorphism cards, hover animations

πŸš€ Quick Start

Prerequisites

  • Python 3.10 or higher
  • pip (Python package manager)
  • GPU recommended (CUDA-compatible) for faster inference

Installation

# Clone the repository
git clone https://github.com/hamidraiz786/HaulVision.git
cd HaulVision

# Install dependencies
pip install -r requirements.txt

Run the App

streamlit run app.py

The app will open at http://localhost:8501 in your default browser.

Note: On first launch, the model (~51MB) will be automatically downloaded from Hugging Face and cached locally.


πŸ“ Project Structure

HaulVision/
β”œβ”€β”€ app.py                 # Main Streamlit application (single-file)
β”œβ”€β”€ kvision5.pt            # Fine-tuned YOLO model weights
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ README.md              # This file
β”œβ”€β”€ assets/
β”‚   └── banner.jpg         # Repository banner image
└── .streamlit/
    └── config.toml        # Streamlit theme configuration

πŸ–₯️ Usage

Image Detection

  1. Select πŸ“· Image mode in the sidebar
  2. Upload an image (JPG, PNG, BMP, or WEBP)
  3. Adjust Confidence and NMS IoU thresholds as needed
  4. View results in the Detection Result, Original Image, and Details tabs
  5. Click ⬇️ Download Annotated Image to save results

Video Detection

  1. Select 🎬 Video mode in the sidebar
  2. Upload a video (MP4, AVI, MOV, MKV, or WMV)
  3. Adjust Frame Skip to control processing speed (higher = faster)
  4. Click πŸš€ Run Detection to begin processing
  5. Monitor real-time progress and frame previews
  6. Download the annotated video when processing completes

βš™οΈ Configuration

Sidebar Controls

Control Range Default Description
Confidence Threshold 0.05 – 1.0 0.25 Minimum detection confidence score
NMS IoU Threshold 0.05 – 1.0 0.45 Non-Maximum Suppression overlap threshold
Frame Skip (Video) 1 – 10 2 Process every N-th frame for speed

Theme Customization

Edit .streamlit/config.toml to customize the app's appearance:

[theme]
primaryColor = "#00D4FF"
backgroundColor = "#0E1117"
secondaryBackgroundColor = "#161B22"
textColor = "#E6EDF3"

🧠 Model Details

Property Value
Architecture YOLO (Fine-tuned)
Task Object Detection
Specialization Truck identification in highway & logistics
Model Size ~51 MB
Input Resolution 640Γ—640
Hosted On πŸ€— Hugging Face

πŸ“¦ Dependencies

streamlit>=1.38.0
ultralytics>=8.2.0
opencv-python-headless>=4.9.0
Pillow>=10.0.0
numpy>=1.24.0
torch>=2.0.0
torchvision>=0.15.0
huggingface-hub>=0.23.0

🐳 Docker Deployment (Optional)

FROM python:3.11-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .
EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
docker build -t haulvision .
docker run -p 8501:8501 haulvision

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Built with ❀️ using Streamlit & Ultralytics YOLO
Model hosted on πŸ€— Hugging Face

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support