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