A tool for collecting object detection datasets with OpenCV
Project description
Detection Data Collection
A Python tool for collecting object detection datasets with bounding boxes using OpenCV. It allows you to draw bounding boxes on live camera/video feed and automatically saves annotated images + YOLO-format labels.
🚀 Installation
pip install detection-datacollection
Or install directly from GitHub:
pip install git+https://github.com/ShashwatDev-26/imageDataCollection.git
📦 Dependencies
This package requires:
numpy==2.2.6opencv-python==4.12.0.88PyYAML==6.0.2
They are automatically installed with pip.
🔧 Usage
1. Import and initialize
from detectionDataCollection import detectionDataCollection
# Create a collector instance
collector = detectionDataCollection()
# Use a video file or camera index (0 for default webcam)
collector.set_sourceID(0) # or "video.mp4"
# Number of samples to capture per class
collector.set_nSamples(10)
# Initialize camera
collector.camera_init_()
# Start annotation mode
collector.annotation()
2. Controls
- CTRL + Left Click → Start drawing bounding box
- Right Click → Add object/class
- CTRL + Right Click → Start capturing samples
- ESC → Stop and save dataset
📂 Output Structure
When you stop annotation (ESC), the dataset is stored like:
detectionDataset/
├── train/
│ ├── images/
│ │ ├── frame_000_000.jpg
│ │ └── ...
│ ├── labels/
│ │ ├── frame_000_000.txt
│ │ └── ...
├── data.yaml
The labels follow YOLO format:
class_id x_center y_center width height
🎥
🌍 Links
- 📦 PyPI: detection-datacollection
- 💻 Source Code: GitHub
- 🐛 Issues: Report bugs here
📜 License
This project is licensed under the MIT License.
To be continued ....
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file detection_datacollection-0.1.0.tar.gz.
File metadata
- Download URL: detection_datacollection-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0289c0ae95e97dfff9c8bf0b7ea7d31145f43c907fa22bd84111d397e4110839
|
|
| MD5 |
c9e86ebe5d8c78a41d85ae0757640dff
|
|
| BLAKE2b-256 |
117f94c959e36de78869b9006b96f0e19c0f9729cb3f4a9fa7a3facfdd7bbd40
|
File details
Details for the file detection_datacollection-0.1.0-py3-none-any.whl.
File metadata
- Download URL: detection_datacollection-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce58ef70654946aceb7ec4b08346c2fd5691c1e721a0ce464ed2b857852a6835
|
|
| MD5 |
516940efc704f3eaf4d87ff3576c035e
|
|
| BLAKE2b-256 |
33e2fc764004142272faf29e9e3680b012a047460f1d0a0e95dfe2fb0f40dbf2
|