Spaces:
Running
Running
Download src/tasks/motion_transfer/__init__.py from vLAR/PhysInOne-Leaderboard: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/spaces/vLAR/PhysInOne-Leaderboard/resolve/main/src/tasks/motion_transfer/__init__.py
- Command line
-
hf download hf://spaces/vLAR/PhysInOne-Leaderboard/src/tasks/motion_transfer/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/vLAR/PhysInOne-Leaderboard/resolve/main/src/tasks/motion_transfer/__init__.py
1.41 kB
| """Frontend metadata for the Motion Transfer task.""" | |
| from __future__ import annotations | |
| from typing import Any, Dict | |
| from src.tasks.base import TaskPlugin | |
| def validate_scene(_scene_dir: str) -> None: | |
| return None | |
| def evaluate_scene(_scene_dir: str, _gt_scene: Any) -> Dict[str, float]: | |
| return {"psnr": 0.0, "ssim": 0.0, "lpips": 0.0, "pmf": 0.0} | |
| def load_gt_scene(scene_id: str, gt_dir: str) -> Any: | |
| return {"scene_id": scene_id, "gt_dir": gt_dir} | |
| TASK = TaskPlugin( | |
| name="motionTransfer", | |
| track_id="motionTransfer", | |
| display_name="Motion Transfer", | |
| description=( | |
| "Transfer motion dynamics from a source video to a target image while preserving " | |
| "the target's visual appearance. Evaluated with PSNR, SSIM, LPIPS, and PMF." | |
| ), | |
| expected_scene_layout=( | |
| "```\n" | |
| "<scene_id>.zip\n" | |
| "`-- CineCamera_n/\n" | |
| " `-- rgb/\n" | |
| " |-- 0000.jpg\n" | |
| " |-- ...\n" | |
| " `-- <last_frame>.jpg\n" | |
| "```" | |
| ), | |
| validate_scene_fn=validate_scene, | |
| evaluate_scene_fn=evaluate_scene, | |
| load_gt_scene_fn=load_gt_scene, | |
| primary_metric="pmf", | |
| higher_is_better=True, | |
| leaderboard_columns=["psnr", "ssim", "lpips", "pmf"], | |
| ) | |
| TASK.column_display_names = { | |
| "psnr": "PSNR", | |
| "ssim": "SSIM", | |
| "lpips": "LPIPS", | |
| "pmf": "PMF", | |
| } | |
| TASKS = { | |
| TASK.name: TASK, | |
| } | |