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/txWP34AQoYTi8Sb/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.zipIf you are interested in 256x256 checkpoints, you can download them from here. We pretrained and finetuned a model on the shortest-path objective, the exact configuration can be found in the corresponding config file within the experiment directory.
# checkpoints
curl -L -o 256x256_experiments.zip https://owncloud.fraunhofer.de/s/64nI0v2AwIrc11i/download
unzip 256x256_experiments.zip
mv basemodel_pretrained_256x256_64k experiments/pretraining/basemodel_pretrained_256x256_64k
mv basemodel_mindist_256x256_64k experiments/runs/basemodel_mindist_256x256_64k
# data
curl -L -o TMP_64k256x256_rgb.zip https://owncloud.fraunhofer.de/s/fcDJv8sDjLcLadi/download
unzip TMP_64k256x256_rgb.zip
mv TMP_64k256x256_rgb data/TMP_64k256x256_rgbThe used dataset is a 256x256 variant of TMP with 64k samples (51.2k/6.4k/6.4k split).
This 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{kim2026flexpathadaptinglearnedconn,
title={FlexPath: Adapting Learned Connectivity Guidance to Path Preferences},
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},
}


