Spaces:
Running

HAHAHA97 commited on
Commit
5f606bc
·
1 Parent(s): e28e6e6

mpm_parameters_estimation

Browse files
src/tasks/__init__.py CHANGED
@@ -6,10 +6,12 @@ from typing import Dict
6
 
7
  from src.tasks.base import TaskPlugin
8
  from src.tasks.task_future_prediction import TASK as TASK_FUTURE_PRED
 
9
  from src.tasks.task_property_estimation import TASK as TASK_PROPERTY_EST
10
 
11
  TASKS: Dict[str, TaskPlugin] = {
12
  TASK_FUTURE_PRED.name: TASK_FUTURE_PRED,
 
13
  TASK_PROPERTY_EST.name: TASK_PROPERTY_EST,
14
  }
15
 
 
6
 
7
  from src.tasks.base import TaskPlugin
8
  from src.tasks.task_future_prediction import TASK as TASK_FUTURE_PRED
9
+ from src.tasks.task_mpm_parameter_estimation import TASK as TASK_MPM_PARAM_EST
10
  from src.tasks.task_property_estimation import TASK as TASK_PROPERTY_EST
11
 
12
  TASKS: Dict[str, TaskPlugin] = {
13
  TASK_FUTURE_PRED.name: TASK_FUTURE_PRED,
14
+ TASK_MPM_PARAM_EST.name: TASK_MPM_PARAM_EST,
15
  TASK_PROPERTY_EST.name: TASK_PROPERTY_EST,
16
  }
17
 
src/tasks/task_mpm_parameter_estimation/__init__.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Task: MPM Parameter Estimation."""
2
+ from __future__ import annotations
3
+
4
+ from typing import Any, Dict
5
+
6
+ from src.tasks.base import TaskPlugin
7
+
8
+
9
+ def validate_scene(_scene_dir: str) -> None:
10
+ return None
11
+
12
+
13
+ def evaluate_scene(_scene_dir: str, _gt_scene: Any) -> Dict[str, float]:
14
+ return {
15
+ "overall_error": 0.0,
16
+ "velocity_mae": 0.0,
17
+ "newtonian_error": 0.0,
18
+ "non_newtonian_error": 0.0,
19
+ "elastic_error": 0.0,
20
+ "plasticine_error": 0.0,
21
+ "sand_error": 0.0,
22
+ }
23
+
24
+
25
+ def load_gt_scene(scene_id: str, gt_dir: str) -> Any:
26
+ return {"scene_id": scene_id, "gt_dir": gt_dir}
27
+
28
+
29
+ TASK = TaskPlugin(
30
+ name="task_mpm_parameter_estimation",
31
+ display_name="MPM Parameter Estimation",
32
+ description=(
33
+ "Predict MPM material parameters and initial velocity. "
34
+ "This first version records full history metrics and uses a temporary "
35
+ "overall error for history/queue reporting."
36
+ ),
37
+ expected_scene_layout=(
38
+ "```\n"
39
+ "<scene_id>.zip\n"
40
+ "├── prediction.json\n"
41
+ "└── initvelocity.json # {\"vx\": float, \"vy\": float, \"vz\": float}\n"
42
+ "```"
43
+ ),
44
+ validate_scene_fn=validate_scene,
45
+ evaluate_scene_fn=evaluate_scene,
46
+ load_gt_scene_fn=load_gt_scene,
47
+ primary_metric="overall_error",
48
+ higher_is_better=False,
49
+ leaderboard_columns=[
50
+ "overall_error",
51
+ "velocity_mae",
52
+ "newtonian_error",
53
+ "non_newtonian_error",
54
+ "elastic_error",
55
+ "plasticine_error",
56
+ "sand_error",
57
+ ],
58
+ )