Improve mask generation script for nuScenes data (#1679)

* Fix bug: Improve mask generation script for nuScenes data

* Run black

---------

Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
Co-authored-by: Matthew Tancik <mattt4001@gmail.com>
This commit is contained in:
authored and GitHub committed 2023-04-20 10:08:30 -07:00
1 parent 9a61851bcf
commit efd33b5248
1 file changed
+4 -1
+4 -1
View File
@@ -79,8 +79,11 @@ class ProcessNuScenesMasks:
# Instead use BoxVisibility.NONE and make sure to rasterize box faces correctly
mask = np.ones((900, 1600), dtype=np.uint8)
for box in boxes:
# If is backcam, mask the truck of the ego vehicle
if camera == "CAM_BACK":
mask[-100:] = 0
for box in boxes:
# Dont mask out static objects (static in all frames)
instance_token = nusc.get("sample_annotation", box.token)["instance_token"]
if not instances_is_dynamic[instance_token]: