Download scripts/run_all.py from minhy112/FallKLTN: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/minhy112/FallKLTN/resolve/main/scripts/run_all.py
- Command line
-
hf download hf://minhy112/FallKLTN/scripts/run_all.py
-
curl -L -o run_all.py https://huggingface.co/minhy112/FallKLTN/resolve/main/scripts/run_all.py
1.48 kB
| #!/usr/bin/env python3 | |
| from __future__ import annotations | |
| import argparse | |
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| def run(command: list[str]) -> None: | |
| print("\n$", " ".join(command), flush=True) | |
| subprocess.run(command, check=True) | |
| def main() -> None: | |
| parser = argparse.ArgumentParser(description="Run the complete experiment") | |
| parser.add_argument("--dataset", default="data/processed/urfd_pose.npz") | |
| parser.add_argument("--config", default="configs/default.yaml") | |
| parser.add_argument("--output", default="artifacts/experiments/urfd") | |
| parser.add_argument("--seed", type=int) | |
| parser.add_argument("--device", choices=["auto", "cpu", "cuda"], default="auto") | |
| args = parser.parse_args() | |
| python = sys.executable | |
| dataset = args.dataset | |
| output = args.output | |
| if not Path(dataset).exists(): | |
| run([python, "scripts/download_urfd.py"]) | |
| run([python, "scripts/prepare_dataset.py", "--config", args.config, "--output", dataset]) | |
| common = ["--dataset", dataset, "--config", args.config, "--output", output] | |
| if args.seed is not None: | |
| common.extend(["--seed", str(args.seed)]) | |
| run([python, "scripts/train_baselines.py", *common]) | |
| run([python, "scripts/train_gru.py", *common, "--device", args.device]) | |
| run([python, "scripts/train_tcn.py", *common, "--device", args.device]) | |
| run([python, "scripts/compare_models.py", "--input", output]) | |
| if __name__ == "__main__": | |
| main() | |