Skip to content

Commit

Permalink
update to rerun 0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
nmvrs committed Sep 1, 2024
1 parent b66c78b commit 24267cc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ trimesh>=4.0.5
numpy
rich>=10.16.1
colour==0.1.5
rerun-sdk==0.15.1
rerun-sdk>=0.18.0
importlib-metadata>=7.1.0
6 changes: 3 additions & 3 deletions rerun_animation/actions/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def run():
else:
data_file = data_files[0]

log.info(f"\t:orange_circle:\tProcessing [italic]{data_file}[/] ...")
log.info(f"\t:orange_circle:Processing [italic]{data_file}[/] ...")
with open(data_file, 'rb') as f:
body_data = pickle.load(f, encoding='latin1')
shape_blendshapes = np.ascontiguousarray(np.array(body_data['shapedirs']).astype(np.float32))
Expand All @@ -106,7 +106,7 @@ def run():
faces=faces, parents=parents, normals=mesh.vertex_normals,
)
log.info(f"\t:green_circle:Done.")
log.debug(f"\t\tSaved @ [italic]{output_filename}[/] ...")
log.debug(f"\tSaved @ [italic]{output_filename}[/] ...")

if uses_external:
log.info(f"\t:warning:[bold yellow blink]Creating symlink to[/] [italic]{output_filename}[/] ...")
Expand Down Expand Up @@ -149,7 +149,7 @@ def run():
faces=faces, parents=parents, normals=mesh.vertex_normals,
)
log.info(f"\t:green_circle:Done.")
log.debug(f"Saved @ [italic]{output_filename}[/] ...")
log.debug(f"\tSaved @ [italic]{output_filename}[/] ...")

if uses_external:
log.info(f"\t:warning:Creating symlink to [italic]{output_filename}[/] ...")
Expand Down
24 changes: 15 additions & 9 deletions rerun_animation/rerun-loader-animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ def log_bvh(filename: str, entity_path: str, config) -> None:
color = colour.Color(color_key).get_rgb() + (0.5,)

rr.log("/", rr.AnnotationContext(rr.ClassDescription(
info=rr.AnnotationInfo(id=0, label=entity_path, color=color),
keypoint_annotations=[rr.AnnotationInfo(id=id, label=j) for id, j in enumerate(joint_names)],
#NOTE: until the issue w/ the labels taking up all space is resolved, we will not be logging them
# info=rr.AnnotationInfo(id=0, label=entity_path, color=color),
# keypoint_annotations=[rr.AnnotationInfo(id=id, label=j) for id, j in enumerate(joint_names)],
info=rr.AnnotationInfo(id=0, label=None, color=color),
keypoint_annotations=[rr.AnnotationInfo(id=id, label=None) for id, j in enumerate(joint_names)],
keypoint_connections=list(filter(lambda t: t[1] > 0, enumerate(parents))),
)), timeless=True)
)), static=True)

if show_rotations := config.getboolean('bvh.options', 'show_rotations', fallback=False):
axii_colors = np.array([[255, 0, 0], [0, 255, 0], [0, 0, 255]])
Expand Down Expand Up @@ -133,10 +136,13 @@ def log_smpl_body(data_root: str, filepath: str, entity_path: str, config) -> No
skeleton_color = colour.Color(skeleton_color_key).get_rgb() + (0.5,)

rr.log("/", rr.AnnotationContext(rr.ClassDescription(
info=rr.AnnotationInfo(id=0, label=entity_path, color=skeleton_color),
keypoint_annotations=[rr.AnnotationInfo(id=id, label=j) for id, j in enumerate(SMPL_JOINT_NAMES)],
#NOTE: until the issue w/ the labels taking up all space is resolved, we will not be logging them
# info=rr.AnnotationInfo(id=0, label=entity_path, color=skeleton_color),
# keypoint_annotations=[rr.AnnotationInfo(id=id, label=j) for id, j in enumerate(SMPL_JOINT_NAMES)],
info=rr.AnnotationInfo(id=0, label=None, color=skeleton_color),
keypoint_annotations=[rr.AnnotationInfo(id=id, label=None) for id, j in enumerate(SMPL_JOINT_NAMES)],
keypoint_connections=list(filter(lambda t: t[1] > 0, enumerate(parents))),
)), timeless=True)
)), static=True)

if mesh_color_key := config.get(f'{body_type}.options', 'color', fallback=None):
mesh_color = colour.Color(mesh_color_key).get_rgb() + (0.5,)
Expand All @@ -161,8 +167,8 @@ def log_smpl_body(data_root: str, filepath: str, entity_path: str, config) -> No
class_ids=0, keypoint_ids=range(max(posed_joints.shape))))
rr.log(f"/{entity_path}/mesh", rr.Mesh3D(
vertex_positions=posed_vertices + translation[i],
indices=faces, vertex_normals=posed_normals,
mesh_material=rr.Material(mesh_color)
triangle_indices=faces, vertex_normals=posed_normals,
albedo_factor=rr.AlbedoFactor(mesh_color)
))

def get_args() -> None:
Expand Down Expand Up @@ -251,7 +257,7 @@ def main() -> None:
coord_system = rr.ViewCoordinates.RIGHT_HAND_Y_UP
case 'z':
coord_system = rr.ViewCoordinates.RIGHT_HAND_Z_UP
rr.log("/", coord_system, timeless=True)
rr.log("/", coord_system, static=True)

match mode:
case Mode.BVH:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_requirements():
return requirements

PACKAGE_NAME = 'rerun-animation'
VERSION = '0.0.5'
VERSION = '0.0.6'
AUTHOR = 'Moverse P.C.'
EMAIL = 'info@moverse.ai'
LICENSE = 'Apache 2.0'
Expand Down

0 comments on commit 24267cc

Please sign in to comment.