Skip to content

Commit

Permalink
Merge pull request #337 from google-research/EEAA78D530AEAD4AECE54CC2…
Browse files Browse the repository at this point in the history
…4E23C682

Internal change - Enables segmentation_id to work.
  • Loading branch information
burrussmp authored Nov 26, 2024
2 parents 3f87a26 + 9c23fa9 commit a9e4113
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kubric/renderer/blender_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,11 @@ def replace_cryptomatte_hashes_by_asset_index(
new_segmentation_ids = np.zeros_like(segmentation_ids)
for idx, asset in enumerate(assets, start=1):
asset_hash = mm3hash(asset.uid)
new_segmentation_ids[segmentation_ids == asset_hash] = idx
if hasattr(asset, "segmentation_id") and asset.segmentation_id is not None:
uid = asset.segmentation_id
else:
uid = idx
new_segmentation_ids[segmentation_ids == asset_hash] = uid
return new_segmentation_ids


Expand Down Expand Up @@ -472,5 +476,3 @@ def process_rgba(exr_layers, scene): # pylint: disable=unused-argument

def process_rgb(exr_layers, scene): # pylint: disable=unused-argument
return exr_layers["rgba"][..., :3]


0 comments on commit a9e4113

Please sign in to comment.