cube-detection-obb / README.md
mohsinarf's picture
Upload folder using huggingface_hub
f3ee93a verified
---
license: mit
task_categories:
- object-detection
tags:
- yolo
- obb
- oriented-bounding-box
- cubes
- robotics
- synthetic
size_categories:
- n<1K
pretty_name: Colored Cubes OBB Detection
---
# Colored Cubes OBB Detection Dataset
A small object-detection dataset for **oriented bounding box (OBB)** detection of
four colored cubes (green, yellow, blue, red). Intended for training and
benchmarking YOLO-OBB style models in robotic-manipulation and pick-and-place
contexts.
## Dataset Summary
- **Task:** Oriented bounding box detection (4-point polygon per object)
- **Classes:** 4 — `green_cube`, `yellow_cube`, `blue_cube`, `red_cube`
- **Images:** 215 total · 1280×720 JPEG
- **Format:** Ultralytics YOLO-OBB
- **Splits:**
| Split | Images | green | yellow | blue | red |
|-------|-------:|------:|-------:|-----:|----:|
| train | 150 | 150 | 153 | 147 | 150 |
| val | 43 | 43 | 44 | 42 | 43 |
| test | 22 | 22 | 22 | 22 | 22 |
Every image contains all four cubes.
## Directory Layout
```
.
├── dataset.yaml # Ultralytics data config
├── train/
│ ├── images/ # 00001.jpg …
│ └── labels/ # 00001.txt …
├── val/
│ ├── images/
│ └── labels/
└── test/
├── images/
└── labels/
```
## Label Format
Each `labels/*.txt` has one object per line, in YOLO-OBB format:
```
class_id x1 y1 x2 y2 x3 y3 x4 y4
```
- `class_id` — integer 0–3 (see `dataset.yaml`)
- `x*, y*` — polygon corner coordinates, **normalized** to `[0, 1]` by image
width/height, traversed in order (TL → TR → BR → BL).
Example:
```
0 0.3460 0.5683 0.4078 0.5917 0.3890 0.7493 0.3271 0.7259
```
## Usage
### With Ultralytics YOLO
```bash
pip install ultralytics huggingface_hub
```
```python
from huggingface_hub import snapshot_download
from ultralytics import YOLO
local_dir = snapshot_download(
repo_id="<your-username>/cubes-obb",
repo_type="dataset",
)
model = YOLO("yolo11n-obb.pt")
model.train(data=f"{local_dir}/dataset.yaml", epochs=100, imgsz=1280)
```
### Loading labels manually
```python
from pathlib import Path
def load_obb(label_path):
out = []
for line in Path(label_path).read_text().splitlines():
parts = line.split()
cls = int(parts[0])
coords = list(map(float, parts[1:])) # 8 floats
out.append((cls, coords))
return out
```
## Class Mapping
| ID | Name |
|----|--------------|
| 0 | green_cube |
| 1 | yellow_cube |
| 2 | blue_cube |
| 3 | red_cube |
## Author
Mohsin Ali — [Movensys](https://movensys.com)
## Collection & Annotation
Images were captured for a cube pick-and-place / OBB-detection research
workflow. Labels are in Ultralytics YOLO-OBB polygon format.
## Limitations
- **Small scale (215 images).** Fine for fine-tuning a pretrained OBB model,
too small to train from scratch.
- **Every image contains all four cubes in similar scenes.** Models trained
here may not generalize to scenes with missing cubes, unseen backgrounds,
occlusion, or varying lighting.
- **Single resolution (1280×720).** Resize / letterbox if your pipeline
expects another size.
## License
Released under the MIT License. See `LICENSE`.
## Citation
If you use this dataset, please cite:
```
@misc{cubes_obb_dataset,
title = {Colored Cubes OBB Detection Dataset},
author = {Mohsin Ali},
year = {2026},
howpublished = {Hugging Face Datasets},
}
```