Download utils/navigation_text.py from ZenoNing/ConsDrive: direct link, hf CLI and curl.
- Browser
- Download file 886 Bytes
-
https://huggingface.co/ZenoNing/ConsDrive/resolve/main/utils/navigation_text.py
- Command line
-
hf download hf://ZenoNing/ConsDrive/utils/navigation_text.py
-
curl -L -o navigation_text.py https://huggingface.co/ZenoNing/ConsDrive/resolve/main/utils/navigation_text.py
886 Bytes
| """Shared navigation-text formatting used by both training and evaluation. | |
| The exact string must match between the dataset (`dataloader/dataset_base.py`) | |
| and the Bench2Drive agent (`team_code/agent_drivevla.py`); keeping the | |
| formatter in one place guarantees that. | |
| """ | |
| def format_target_waypoint_text(target_point, next_target_point) -> str: | |
| """Render the two ego-frame target points as command-suffix text. | |
| One decimal (0.1 m) keeps the token count low while disambiguating | |
| branches; coordinates follow the ego convention used everywhere else | |
| (x forward, y right, metres). | |
| """ | |
| tp1_x, tp1_y = float(target_point[0]), float(target_point[1]) | |
| tp2_x, tp2_y = float(next_target_point[0]), float(next_target_point[1]) | |
| return ( | |
| f" Target waypoint: ({tp1_x:.1f}, {tp1_y:.1f})," | |
| f" then ({tp2_x:.1f}, {tp2_y:.1f})." | |
| ) | |