Skip to content

das-rise/SimForest-YOLO-Toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimForest YOLO Toolkit

A collection of scripts for converting the SimForest dataset to YOLO format, training YOLO detection and segmentation models, and performing depth-filtered validation.

Features

🔄 Dataset Conversion (simforest_to_yolo.py)

  • Convert COCO annotations to YOLO detect and segment formats
  • Split dataset into train/val with configurable ratios
  • Filter by category IDs, minimum diameter, and minimum height
  • Merge multiple categories into a single class
  • Flexible file linking (symlinks or copies)

🚀 Training (yolo11_4k_trainer.py)

  • Train YOLOv11 models at 4K resolution (3840x2160)
  • Support for both detection and segmentation tasks
  • Resume training from checkpoints
  • Configurable hyperparameters and training settings

📊 Validation (depth_filtered_yolov11_validation.py)

  • Validate YOLO models with depth-based filtering
  • Analyze performance at different distance ranges
  • Generate filtered validation metrics

Installation

# Clone the repository
git clone https://github.com/RISE-Dependable-Transport-Systems/simforest-yolo-toolkit.git
cd simforest-yolo-toolkit

# Install dependencies
pip install -r requirements.txt

Usage

1. Convert Dataset

python src/simforest_to_yolo.py \
    --dataset /path/to/simforest \
    --output ./data/simforest_yolo \
    --split 0.8 \
    --seed 42

Advanced options:

# Filter by categories and merge into single class
python src/simforest_to_yolo.py \
    --dataset /path/to/simforest \
    --output ./data/simforest_yolo \
    --categories 9 10 11 \
    --merge-categories "Tree_Trunk" \
    --min-diameter 0.1 \
    --min-height 2.0 \
    --with-depth

# Use file copying instead of symlinks
python src/simforest_to_yolo.py \
    --dataset /path/to/simforest \
    --output ./data/simforest_yolo \
    --copy

2. Train Model

python src/yolo11_4k_trainer.py \
    --data ./data/simforest_yolo/detect/data.yaml \
    --model x \
    --epochs 300 \
    --batch-size 2 \
    --img-size 2560 \
    --task detect

3. Validate with Depth Filtering

python src/depth_filtered_yolov11_validation.py \
    --model ./runs/detect/yolov11x_4k_detect/weights/best.pt \
    --data ./data/simforest_yolo/detect/data.yaml \
    --img-dir ./data/simforest_yolo/detect/images/val \
    --label-dir ./data/simforest_yolo/detect/labels/val \
    --depth-dir ./data/simforest_yolo/depth/val \
    --val-dir ./runs/detect/yolov11x_4k_detect/val \
    --use-depth-filter \
    --img-size 2560 \
    --results-file ./results/detect/yolov11x_4k_detect/val.json \
    --max-distance 15.0 \
    --num-workers 16

Dataset Structure

After conversion, the simforest_yolo dataset will have the following structure:

data/simforest_yolo/
├── detect/
│   ├── images/
│   │   ├── train/
│   │   └── val/
│   ├── labels/
│   │   ├── train/
│   │   └── val/
│   └── data.yaml
├── segment/
│   ├── images/
│   │   ├── train/
│   │   └── val/
│   ├── labels/
│   │   ├── train/
│   │   └── val/
│   └── data.yaml
├── depth/ (optional)
│   ├── train/
│   └── val/
└── annotations/
    ├── train.json
    └── val.json

Citation

If you use this toolkit in your research, please cite:

@INPROCEEDINGS{avula_simforest_2025,
  author={Avula, Ramana Reddy and Narkilahti, Aleksi and Wołk, Krzysztof},
  booktitle={2025 IEEE International Conference on Visual Communications and Image Processing (VCIP)},
  title={SimForest: RGBD Instance Segmentation Dataset},
  year={2025}}

About

SimForest YOLO Toolkit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages