Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,100 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- segmentation
|
| 5 |
+
size_categories:
|
| 6 |
+
- 10K<n<100K
|
| 7 |
---
|
| 8 |
+
# CHIP Dataset - Segmentation Training Guide
|
| 9 |
+
|
| 10 |
+
## Overview
|
| 11 |
+
This dataset is designed for training segmentation models, specifically for human/CHIP segmentation tasks using YOLO models.
|
| 12 |
+
|
| 13 |
+
## Dataset Structure
|
| 14 |
+
After extracting `CHIP_dataset.zip`, the directory structure should include:
|
| 15 |
+
- `train/` and `valid/` folders with images
|
| 16 |
+
- `data.yaml` configuration file for YOLO training
|
| 17 |
+
|
| 18 |
+
## Prerequisites
|
| 19 |
+
- Python environment
|
| 20 |
+
- GPU with CUDA support (recommended)
|
| 21 |
+
|
| 22 |
+
## Installation
|
| 23 |
+
```bash
|
| 24 |
+
pip install ultralytics tqdm
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
## Download and Extract Dataset
|
| 28 |
+
```bash
|
| 29 |
+
# Download dataset
|
| 30 |
+
wget https://huggingface.co/datasets/OSAS-AI/CHIP-Segmentation/resolve/main/CHIP_dataset.zip
|
| 31 |
+
|
| 32 |
+
# Extract
|
| 33 |
+
from zipfile import ZipFile
|
| 34 |
+
from tqdm import tqdm
|
| 35 |
+
import os
|
| 36 |
+
|
| 37 |
+
zip_path = "CHIP_dataset.zip"
|
| 38 |
+
extract_dir = "."
|
| 39 |
+
os.makedirs(extract_dir, exist_ok=True)
|
| 40 |
+
|
| 41 |
+
with ZipFile(zip_path, "r") as zip_ref:
|
| 42 |
+
members = zip_ref.infolist()
|
| 43 |
+
for member in tqdm(members, desc="Extracting", unit="file"):
|
| 44 |
+
zip_ref.extract(member, extract_dir)
|
| 45 |
+
|
| 46 |
+
print(f"Extracted to: {extract_dir}")
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
## Download Pre-trained Model
|
| 50 |
+
```bash
|
| 51 |
+
wget https://huggingface.co/Ultralytics/YOLO26/resolve/main/yolo26s-seg.pt
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
## Training
|
| 55 |
+
```python
|
| 56 |
+
from ultralytics import YOLO
|
| 57 |
+
|
| 58 |
+
# Load model
|
| 59 |
+
model = YOLO('yolo26s-seg.pt') # small variant – good balance
|
| 60 |
+
|
| 61 |
+
# Train
|
| 62 |
+
results = model.train(
|
| 63 |
+
data='data.yaml',
|
| 64 |
+
epochs=300,
|
| 65 |
+
imgsz=640,
|
| 66 |
+
batch=32, # reduce if OOM
|
| 67 |
+
device="0,1", # adjust for your GPUs
|
| 68 |
+
workers=8,
|
| 69 |
+
project='../runs/train',
|
| 70 |
+
name='human_segmentation',
|
| 71 |
+
exist_ok=False,
|
| 72 |
+
patience=15,
|
| 73 |
+
save=True,
|
| 74 |
+
val=True,
|
| 75 |
+
plots=True
|
| 76 |
+
)
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
## Key Training Parameters
|
| 80 |
+
- **Model**: YOLOv26s-seg (segmentation)
|
| 81 |
+
- **Image Size**: 640x640
|
| 82 |
+
- **Epochs**: 300
|
| 83 |
+
- **Batch Size**: 32 (adjust based on VRAM)
|
| 84 |
+
- **Multi-GPU**: Supports `device="0,1"`
|
| 85 |
+
|
| 86 |
+
## Inference / Usage
|
| 87 |
+
After training, the best model will be saved in `runs/train/human_segmentation/weights/best.pt`
|
| 88 |
+
|
| 89 |
+
```python
|
| 90 |
+
model = YOLO('path/to/best.pt')
|
| 91 |
+
results = model('path/to/image.jpg')
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
## Dataset on Hugging Face
|
| 95 |
+
[CHIP-Segmentation](https://huggingface.co/datasets/OSAS-AI/CHIP-Segmentation)
|
| 96 |
+
|
| 97 |
+
For more details, refer to [Ultralytics YOLO documentation](https://docs.ultralytics.com/).
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
You can copy the entire block above and save it as `README.md`. Let me know if you want any changes!
|