File size: 2,371 Bytes
92ce024
 
 
 
 
 
 
 
bc3f22f
92ce024
 
 
293bb2c
bc3f22f
293bb2c
 
 
bc3f22f
 
 
 
 
 
293bb2c
92ce024
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
bc3f22f
 
 
92ce024
 
 
 
 
 
 
8d848b5
92ce024
 
 
 
 
 
 
 
 
 
 
 
 
bc3f22f
 
 
92ce024
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
"""Task: Video Generation (scene-level).

Per-scene metrics: PSNR / SSIM / LPIPS / PMF . The evaluator is initialized on CPU by
default; export ``PHYS_METRIC_DEVICE=cuda`` to opt in to GPU when one is
available to the worker.
"""
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_VIDEO_GEN_STATIC = TaskPlugin(
    name="videoGeneration_static",
    display_name="Video Generation on Static Camera",
    description="Given first frame and caption, generate a physical plausible video on a static camera. " \
                "Metrics: PSNR / SSIM / LPIPS / PMF.",
    expected_scene_layout=(
        "```\n"
        "<scene_id>.zip\n"
        "β”œβ”€β”€ CineCamera_n/\n"
        "β”‚   └── rgb/\n"
        "β”‚       β”œβ”€β”€ ...\n"
        "β”‚       β”œβ”€β”€ 0075.jpg\n"
        "β”‚       └── ...\n"
        "\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_VIDEO_GEN_MOVING = TaskPlugin(
    name="videoGeneration_moving",
    display_name="Video Generation on Moving Camera",
    description="Given first frame and caption, generate a physical plausible video a static camera. " \
                "Metrics: PSNR / SSIM / LPIPS / PMF.",
    expected_scene_layout=(
        "```\n"
        "<scene_id>.zip\n"
        "β”œβ”€β”€ CineCamera_Moving/\n"
        "    └── rgb/\n"
        "β”‚       β”œβ”€β”€ ...\n"
        "β”‚       β”œβ”€β”€ 0075.jpg\n"
        "β”‚       └── ...\n"
        "\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"],
)

TASKS = {
    TASK_VIDEO_GEN_STATIC.name:  TASK_VIDEO_GEN_STATIC,
    TASK_VIDEO_GEN_MOVING.name:  TASK_VIDEO_GEN_MOVING,
}