Spaces:
Runtime error
Runtime error
enhance logging for helper keyframes by adding timeless parameter and reorganizing camera trajectory logging
Browse files- visualization/logger.py +13 -3
- visualization/visualizer.py +3 -2
visualization/logger.py
CHANGED
|
@@ -154,7 +154,8 @@ class SimulationLogger:
|
|
| 154 |
translation=position,
|
| 155 |
rotation=rr.Quaternion(xyzw=rotation_q),
|
| 156 |
scale=(1.0, 1.0, 1.0)
|
| 157 |
-
)
|
|
|
|
| 158 |
)
|
| 159 |
|
| 160 |
rr.log(
|
|
@@ -163,8 +164,17 @@ class SimulationLogger:
|
|
| 163 |
image_from_camera=self.K,
|
| 164 |
width=1920,
|
| 165 |
height=1080,
|
| 166 |
-
|
| 167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
)
|
| 169 |
|
| 170 |
except Exception as e:
|
|
|
|
| 154 |
translation=position,
|
| 155 |
rotation=rr.Quaternion(xyzw=rotation_q),
|
| 156 |
scale=(1.0, 1.0, 1.0)
|
| 157 |
+
),
|
| 158 |
+
timeless=True
|
| 159 |
)
|
| 160 |
|
| 161 |
rr.log(
|
|
|
|
| 164 |
image_from_camera=self.K,
|
| 165 |
width=1920,
|
| 166 |
height=1080,
|
| 167 |
+
),
|
| 168 |
+
timeless=True
|
| 169 |
+
)
|
| 170 |
+
|
| 171 |
+
rr.log(
|
| 172 |
+
"world/helper_keyframes/camera_point_{keyframe_idx}",
|
| 173 |
+
rr.Points3D(
|
| 174 |
+
position,
|
| 175 |
+
colors=np.full((len(position), 4), [1.0, 1.0, 0.0, 1.0])
|
| 176 |
+
),
|
| 177 |
+
timeless=True
|
| 178 |
)
|
| 179 |
|
| 180 |
except Exception as e:
|
visualization/visualizer.py
CHANGED
|
@@ -26,11 +26,12 @@ def visualize_simulation(file, simulation_index: Optional[int]) -> Optional[str]
|
|
| 26 |
logger = SimulationLogger()
|
| 27 |
logger.log_metadata(simulation['instructions'])
|
| 28 |
logger.log_subjects(simulation['subjects'])
|
| 29 |
-
logger.log_camera_trajectory(simulation['cameraFrames'])
|
| 30 |
-
logger.log_camera_frames(simulation['cameraFrames'])
|
| 31 |
|
| 32 |
if 'helper_keyframes' in simulation:
|
| 33 |
logger.log_helper_keyframes(simulation['helper_keyframes'])
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
rr.save(rrd_path)
|
| 36 |
|
|
|
|
| 26 |
logger = SimulationLogger()
|
| 27 |
logger.log_metadata(simulation['instructions'])
|
| 28 |
logger.log_subjects(simulation['subjects'])
|
|
|
|
|
|
|
| 29 |
|
| 30 |
if 'helper_keyframes' in simulation:
|
| 31 |
logger.log_helper_keyframes(simulation['helper_keyframes'])
|
| 32 |
+
|
| 33 |
+
logger.log_camera_trajectory(simulation['cameraFrames'])
|
| 34 |
+
logger.log_camera_frames(simulation['cameraFrames'])
|
| 35 |
|
| 36 |
rr.save(rrd_path)
|
| 37 |
|