Instructions to use bestak/uav-navigation-sasp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- stable-baselines3
How to use bestak/uav-navigation-sasp with stable-baselines3:
from huggingface_sb3 import load_from_hub checkpoint = load_from_hub( repo_id="bestak/uav-navigation-sasp", filename="{MODEL FILENAME}.zip", ) - Notebooks
- Google Colab
- Kaggle
SASP: Saliency-Augmented Static Policy (Phase II)
About this Model
This model is a supplementary artifact for the paper "Saliency-Driven Active Perception for UAV Visual Re-Localization using Reinforcement Learning" (Vojtěch Bešťák, Václav Truhlařík, Libor Přeučil), based on the CTU FIT master's thesis of the same title (Vojtěch Bešťák, 2026).
It is trained with active-perception-uav-nav, a research framework for visual UAV navigation using RL/IL over aerial orthophoto and land-use grid environments.
| Key | Value |
|---|---|
| Algorithm | PPO |
| Environment | aerial_grid |
| W&B group | exp2.2-aerial-ppo-ablation-sasp_3 |
| Run ID | y8w84vhm |
| Reward weights | dist=1.096, view=19.445, time=-0.100, success=311.2 |
| Max steps / episode | 500 |
| Frame stack | 4 |
| Seed | 4 |
| Python (training) | 3.11.14 |
| stable-baselines3 | 2.2.1 |
| PyTorch | 2.10.0 |
| Gymnasium | 0.29.1 |
| Arena size | 1000 m |
| Success radius | 4 cells |
| Saliency channel | yes |
Quantitative Performance
Results are pooled over 3200 evaluation arenas per seed, across five independently trained seeds, in continuous environments over authentic ČÚZK orthophotos. In-domain uses the five training regions; zero-shot uses two held-out regions with no geographic overlap with training.
| Metric | In-domain | Zero-shot |
|---|---|---|
| Success Rate | 99.42% ± 0.56 | 98.51% ± 1.63 |
| Optimality Score | 0.637 ± 0.012 | 0.602 ± 0.011 |
| Path Extension | 1.097 ± 0.030 | 1.088 ± 0.028 |
| Average Localization Error | 51.27 m ± 0.33 | 46.68 m ± 0.33 |
| Recall@1 | 0.667 ± 0.001 | 0.700 ± 0.002 |
SASP closes 27.6% of the Naive–Oracle localization-error gap in-domain and 25.1% zero-shot, without retraining on the held-out regions.
Observation and Action Spaces
| Key | Shape | dtype | Notes |
|---|---|---|---|
camera |
(4, 84, 84, 3) |
uint8 | Aerial orthophoto RGB crop, normalised to [0,1] inside extractor |
visited_mask |
(4, 84, 84) |
uint8 | Cells visited in the current episode crop |
saliency |
(4, 84, 84) |
uint8 | SelaVPR saliency crop |
goal_info |
(24,) |
float32 | Egocentric telemetry and navigation state |
Action space: Box([0, -1], [1, 1], (2,), float32) — [velocity ∈ [0,1], angular_rate ∈ [-1,1]]
Standalone Inference (no active-perception-uav-nav package required)
Install the minimal deps (versions match the training environment):
pip install "stable-baselines3==2.2.1" "torch==2.10.0" "gymnasium==0.29.1" huggingface-hub
import importlib.util, sys, numpy as np
from huggingface_hub import hf_hub_download
from stable_baselines3 import PPO
REPO_ID = "bestak/uav-navigation-sasp"
# 1. Download and load the feature extractor (pure PyTorch, no repo import needed)
fe_path = hf_hub_download(REPO_ID, "feature_extractor.py")
spec = importlib.util.spec_from_file_location("_fe", fe_path)
mod = importlib.util.module_from_spec(spec)
sys.modules["_fe"] = mod
spec.loader.exec_module(mod)
# 1b. Stub out drone_navigation so cloudpickle can resolve ALL saved class references
# (lr_schedule, policy_kwargs, etc.) without the package being installed.
import types as _types
for _name in ["drone_navigation", "drone_navigation.models",
"drone_navigation.models.feature_extractor_aerial",
"drone_navigation.models.feature_extractor_landuse"]:
sys.modules.setdefault(_name, _types.ModuleType(_name))
sys.modules["drone_navigation.models.feature_extractor_aerial"].AerialFeaturesExtractor = mod.AerialFeaturesExtractor
# 2. Load the model -- inject the extractor class so cloudpickle can resolve it
model = PPO.load(
hf_hub_download(REPO_ID, "best_model.zip"),
custom_objects={
"features_extractor_class": mod.AerialFeaturesExtractor,
},
device="cpu",
)
# 3. Run a single forward pass with a dummy observation
obs = {
"camera": np.zeros((4, 84, 84, 3), dtype=np.uint8),
"visited_mask": np.zeros((4, 84, 84), dtype=np.uint8),
"goal_info": np.zeros(24, dtype=np.float32),
"saliency": np.zeros((4, 84, 84), dtype=np.uint8),
}
action, _ = model.predict(obs, deterministic=True)
print("Action:", action)
Note:
custom_objectsoverrides the cloudpickled class reference, which is why theactive-perception-uav-navpackage is not required for loading. Seeinference.pyin this repo for the full example including environment rollouts.
Full Inference with the active-perception-uav-nav Package
pip install git+https://github.com/bestak/active-perception-uav-nav.git
# also requires map data -- see the repo README for data preparation
from huggingface_hub import hf_hub_download
from stable_baselines3 import PPO
from drone_navigation.config.experiment_config import ExperimentConfig
from drone_navigation.envs.factory import create_env
REPO_ID = "bestak/uav-navigation-sasp"
# When drone_navigation is installed, the extractor class resolves automatically
model = PPO.load(hf_hub_download(REPO_ID, "best_model.zip"), device="cpu")
cfg = ExperimentConfig.from_json(hf_hub_download(REPO_ID, "config.json"))
cfg.n_envs = 1
env = create_env(cfg)
obs, _ = env.reset()
for _ in range(cfg.max_steps):
action, _ = model.predict(obs, deterministic=True)
obs, reward, terminated, truncated, info = env.step(action)
if terminated or truncated:
print("Episode done. Target reached:", info.get("is_target_reached"))
break
env.close()
See inference.py in this repo for a more complete example with multi-episode evaluation.
Training
git clone https://github.com/bestak/active-perception-uav-nav.git
cd active-perception-uav-nav
uv sync
drone-train-rl --env_type aerial_grid ...
Citation
If you use this model, please cite the paper:
@misc{bestak2026:saliencyactiveperception,
author = {Be{\v{s}}{\v{t}}{\'a}k, Vojt{\v{e}}ch and Truhla{\v{r}}{\'i}k, V{\'a}clav and P{\v{r}}eu{\v{c}}il, Libor},
title = {Saliency-Driven Active Perception for UAV Visual Re-Localization using Reinforcement Learning},
year = {2026}
}
- Downloads last month
- 52