File size: 3,458 Bytes
4741fb1
03b0173
 
 
 
 
 
 
4741fb1
 
03b0173
 
4741fb1
 
03b0173
 
54708e8
4741fb1
 
 
 
8682bcd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b1e77e5
8682bcd
4741fb1
54708e8
 
03b0173
28c5be0
 
4741fb1
 
28c5be0
 
8682bcd
4741fb1
54708e8
03b0173
54708e8
28c5be0
 
 
 
 
 
 
03b0173
 
54708e8
 
 
28c5be0
 
4741fb1
28c5be0
 
 
 
 
 
 
 
 
4741fb1
 
 
03b0173
4741fb1
 
28c5be0
 
 
 
 
 
 
 
 
 
 
 
69a65f8
 
 
 
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
"""Task: Physical Property Estimation."""
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 {"overall_error": 0.0}


def load_gt_scene(scene_id: str, gt_dir: str) -> Any:
    return {"scene_id": scene_id, "gt_dir": gt_dir}


EXCEL_SUMMARY_SPECS = {
    "N μ": {"source": "newtonian_log10_mu", "scale": 100.0, "digits": 2},
    "N κ": {"source": "newtonian_log10_kappa", "scale": 100.0, "digits": 2},
    "N v": {"source": "newtonian_v", "scale": 100.0, "digits": 2},
    "NN μ": {"source": "non_newtonian_log10_mu", "scale": 100.0, "digits": 2},
    "NN κ": {"source": "non_newtonian_log10_kappa", "scale": 100.0, "digits": 2},
    "NN y": {"source": "non_newtonian_log10_yield", "scale": 100.0, "digits": 2},
    "NN η": {"source": "non_newtonian_log10_eta", "scale": 100.0, "digits": 2},
    "NN v": {"source": "non_newtonian_v", "scale": 100.0, "digits": 2},
    "E E": {"source": "elastic_log10_E", "scale": 100.0, "digits": 2},
    "E ν": {"source": "elastic_nu", "scale": 100.0, "digits": 2},
    "E v": {"source": "elastic_v", "scale": 100.0, "digits": 2},
    "P E": {"source": "plasticine_log10_E", "scale": 100.0, "digits": 2},
    "P y": {"source": "plasticine_log10_yield", "scale": 100.0, "digits": 2},
    "P ν": {"source": "plasticine_nu", "scale": 100.0, "digits": 2},
    "P v": {"source": "plasticine_v", "scale": 100.0, "digits": 2},
    "S φ": {"source": "sand_friction", "scale": 1.0, "digits": 2},
    "S v": {"source": "sand_v", "scale": 100.0, "digits": 2},
}


TASK = TaskPlugin(
    name="propertyEstimation",
    display_name="Properties Estimation",
    description=(
        "Predict MPM material parameters and initial velocity. "
        "This task jointly evaluates MPM Parameter Estimation, Reinitialized Simulation "
        "Rendering, and Novel View Synthesis. "
        "Abbreviations: N=newtonian, NN=non-newtonian, E=elastic, P=plasticine, S=sand."
    ),
    expected_scene_layout=(
        "```\n"
        "<scene_id>.zip\n"
        "`-- property_estimation/\n"
        "    |-- materials_configs.json\n"
        "    |-- initvelocity.json   # {\"vx\": float, \"vy\": float, \"vz\": float}\n"
        "    |-- novel/\n"
        "    |   `-- CineCamera_*/rgb/<frame>.jpg\n"
        "    `-- reinit/\n"
        "        `-- CineCamera_*/rgb/<frame>.jpg\n"
        "```"
    ),
    validate_scene_fn=validate_scene,
    evaluate_scene_fn=evaluate_scene,
    load_gt_scene_fn=load_gt_scene,
    primary_metric="rendering_pmf",
    higher_is_better=True,
    leaderboard_columns=[
        "rendering_pmf",
        "novel_pmf",
        "reinit_pmf",
        "novel_psnr",
        "novel_ssim",
        "novel_lpips",
        "reinit_psnr",
        "reinit_ssim",
        "reinit_lpips",
        "overall_error",
        *EXCEL_SUMMARY_SPECS.keys(),
    ],
)

TASK.excel_summary_specs = EXCEL_SUMMARY_SPECS
TASK.column_display_names = {
    "rendering_pmf": "rendering pmf",
    "novel_pmf": "novel pmf",
    "reinit_pmf": "reinit pmf",
    "novel_psnr": "novel psnr",
    "novel_ssim": "novel ssim",
    "novel_lpips": "novel lpips",
    "reinit_psnr": "reinit psnr",
    "reinit_ssim": "reinit ssim",
    "reinit_lpips": "reinit lpips",
    "overall_error": "param overall",
}

TASKS = {
    TASK.name: TASK,
}