Generate Lightweight Object Detector
This is a lightweight custom object detection framework built with PyTorch.
Designed for:
- CPU inference
- Low-resource systems
- Your own datasets
- Educational purposes
- Simple and fast in cpu
This project provides a minimal object detector that can be trained from scratch using custom images and YOLO-format labels.
Features
- Lightweight CNN architecture
- Fast CPU inference
- Simple training pipeline
- YOLO label format support
- Multi-box prediction
- Minimal dependencies
- Easy to understand and modify
- Suitable for custom datasets
Use Cases
- Signature detection
- Symbol detection
- Embedded AI
- Raspberry Pi projects
- Lightweight vision systems
Dataset Format
Images:
Use at least 200 images of a single class object, max object in an image =5
Labels:
Findout all labels of each object and rearange them like yolo format.
class x_center y_center width height
Example:
0 0.52 0.48 0.31 0.65
Installation
Install dependencies:
pip install -r requirements.txt
Training
Edit dataset paths inside train.py.
Run training:
python train.py
The trained model will be saved as:
my_model.pth
Inference
Edit image paths inside predict.py. Give a new image to predict and draw the boundary.
Run prediction:
python predict.py
Output image with bounding boxes will be saved automatically.
Model Architecture
The detector uses:
- 3 convolution layers
- max pooling
- fully connected prediction heads
Outputs:
- bounding box coordinates
- confidence scores
Limitations
- Single-class detection
- Fixed maximum(5) box count
Author
Created by Nayon.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support