Spaces:
Runtime error
Runtime error
Update visualization/visualizer.py
Browse files- visualization/visualizer.py +15 -3
visualization/visualizer.py
CHANGED
|
@@ -24,15 +24,27 @@ def visualize_simulation(file, simulation_index: Optional[int]) -> Optional[str]
|
|
| 24 |
simulation = simulations[simulation_index]
|
| 25 |
|
| 26 |
logger = SimulationLogger()
|
|
|
|
|
|
|
| 27 |
logger.log_metadata(simulation['instructions'])
|
|
|
|
|
|
|
| 28 |
logger.log_subjects(simulation['subjects'])
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
| 33 |
logger.log_camera_trajectory(simulation['cameraFrames'])
|
|
|
|
|
|
|
| 34 |
logger.log_camera_frames(simulation['cameraFrames'])
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
rr.save(rrd_path)
|
| 37 |
|
| 38 |
return rrd_path
|
|
|
|
| 24 |
simulation = simulations[simulation_index]
|
| 25 |
|
| 26 |
logger = SimulationLogger()
|
| 27 |
+
|
| 28 |
+
# Log metadata
|
| 29 |
logger.log_metadata(simulation['instructions'])
|
| 30 |
+
|
| 31 |
+
# Log subjects (individual frames)
|
| 32 |
logger.log_subjects(simulation['subjects'])
|
| 33 |
|
| 34 |
+
# Log subject trajectories (full center path)
|
| 35 |
+
logger.log_subject_trajectories(simulation['subjects'])
|
| 36 |
+
|
| 37 |
+
# Log camera trajectory (full path)
|
| 38 |
logger.log_camera_trajectory(simulation['cameraFrames'])
|
| 39 |
+
|
| 40 |
+
# Log individual camera frames
|
| 41 |
logger.log_camera_frames(simulation['cameraFrames'])
|
| 42 |
|
| 43 |
+
# Log helper keyframes if available
|
| 44 |
+
if 'helper_keyframes' in simulation:
|
| 45 |
+
logger.log_helper_keyframes(simulation['helper_keyframes'])
|
| 46 |
+
|
| 47 |
+
# Save the visualization data
|
| 48 |
rr.save(rrd_path)
|
| 49 |
|
| 50 |
return rrd_path
|