| 173 | |
| 174 | |
| 175 | def write_run_metadata(args: argparse.Namespace, output_dir: Path, camera_info: dict[str, str]) -> None: |
| 176 | metadata = { |
| 177 | "created_at": datetime.now().isoformat(timespec="seconds"), |
| 178 | "camera": camera_info, |
| 179 | "model": args.model, |
| 180 | "backend": "tensorrt", |
| 181 | "stream": {"width": args.width, "height": args.height, "fps": args.fps}, |
| 182 | "display": args.show_display, |
| 183 | "viser": { |
| 184 | "enabled": args.show_viser, |
| 185 | "host": args.viser_host, |
| 186 | "port": args.viser_port, |
| 187 | "mode": args.viser_mode, |
| 188 | "pointcloud_stride": args.pointcloud_stride, |
| 189 | "pointcloud_min_depth": args.pointcloud_min_depth, |
| 190 | "pointcloud_max_depth": args.pointcloud_max_depth, |
| 191 | "pointcloud_update_hz": args.pointcloud_update_hz, |
| 192 | }, |
| 193 | } |
| 194 | (output_dir / "run_metadata.json").write_text(json.dumps(metadata, indent=2), encoding="utf-8") |
| 195 | |
| 196 | |
| 197 | def run_demo(args: argparse.Namespace) -> int: |