Train a neural network to predict where paths can go (Stage 1), then adapt it to decide which path you actually want (Stage 2), shortest, safest, semantic-aware, or waypoint-guided, all from the same pretrained model.
| Optimal | Obstacle Avoidance | Semantic Avoidance | Waypoint |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
The model predicts a heuristic in a single-shot fashion, then a classical search algorithms (Focal Search) navigates the map. Dark green nodes were expanded, the last frame shows the final path. Our heuristic strongly pushes the search algorithm towards the target almost without unnecessary exploration, all while aligning with the trained preference.
- ✅ Training code for Stage I (pretraining) and Stage II (fine-tuning)
- ✅ Implementation of all PSOs
- ✅ Basic evaluation scripts
Note
This branch is kept lightweight for easier extendability. See the full branch for baseline implementations used in the paper.
- Python 3.9 (see
pyproject.toml) - CUDA GPU recommended for training
git clone https://github.com/FraunhoferIVI/FlexPathCompilation dependencies::
apt install g++(for cstar dependency and torch.compile)
Python dependencies: Option 1 (uv):
uv syncOption 2 (pip):
python -m venv .venv
source .venv/bin/activate
pip install .curl -L -o experiments.zip https://owncloud.fraunhofer.de/index.php/s/pvO2lJaNFI1IOId/download
unzip experiments.zipmkdir data
cd data
# TMP (512/64/64k)
curl -L -o TMP_640k_rgb.zip https://owncloud.fraunhofer.de/index.php/s/Md4nGgqQCGrUii8/download
unzip TMP_640k_rgb.zip
# CSM 1.9k (test only)
curl -L -o csm_1900.zip https://owncloud.fraunhofer.de/index.php/s/OdaJnfZwU1NGu4Z/download
unzip csm_1900.zip
# Starcraft 6k (test only)
curl -L -o starcraft_6k.zip https://owncloud.fraunhofer.de/index.php/s/51Dc4CPEwtztXYd/download
unzip starcraft_6k.zipThis is only required if you want to retrain or evaluate the waypoint/semantic obstacle avoidance objectives.
uv run python scripts/datagen/generate_semantic_obstacle_dataset.py
uv run python scripts/datagen/generate_waypoint_dataset.pyscripts/pretraining/train_actor.py: actor pretraining entrypointscripts/training/train_singleshot_pso.py: single-shot fine-tuning entrypointconfigs/: Hydra configs for training, models, and datasetsdocs/: detailed guides for pretraining, finetuning, and evaluationsrc/: core code (datasets, models, PSO objectives, training loops)experiments/: default output location for runs
Entrypoint: scripts/pretraining/train_actor.py
For a detailed guide, see docs/pretraining.md.
Run with defaults:
python scripts/pretraining/train_actor.pyEntrypoint: scripts/training/train_singleshot_pso.py
For a detailed guide, see docs/finetuning.md.
Run with defaults:
python scripts/training/train_singleshot_pso.pySee docs/evaluation.md for how to run the evaluation script and interpret its outputs.
Take a look at the notebooks folder for visualizations.
See docs/pretraining.md and docs/finetuning.md on how to add new backbones, PSOs or datasets.
- All scripts are Hydra entrypoints; any config value can be overridden at the
CLI with
key=valuesyntax. - Always use the 'latest' checkpoint over the 'best'. This is because the scaling of some components increase over the course of the training, which causes total loss / reward to become worse.
@misc{kim2026flexpathlearnedsemanticpath,
title={FlexPath: Learned Semantic Path Priors for Image-Based Planning},
author={Taehyoung Kim and Tim Schoenbrod and David Eckel and Henri Meeß},
year={2026},
eprint={2606.10167},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2606.10167},
}


