Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part number with debris annotation #1020

Closed
shawrby opened this issue Jan 7, 2024 · 1 comment
Closed

Part number with debris annotation #1020

shawrby opened this issue Jan 7, 2024 · 1 comment

Comments

@shawrby
Copy link

shawrby commented Jan 7, 2024

Hi,

I'm currently researching debris detection on driving roads.

Could you know me which download part numbers contains debris annotations?

Thanks in advance.

@whyekit-motional
Copy link
Collaborator

@shawrby you could use something like this to retrieve all the scenes that contain at least one movable_object.debris object:

from tqdm import tqdm 

from nuscenes.nuscenes import NuScenes


nusc = NuScenes(version='v1.0-mini', dataroot='/data/sets/nuscenes', verbose=False)

scene_tokens = set()
for sample in tqdm(nusc.sample):
    scene_token = sample['scene_token']
    
    for ann_token in sample['anns']:
        ann = nusc.get('sample_annotation', ann_token)
        category_name = ann['category_name'] 
        
        if category_name == 'movable_object.debris':
            scene_tokens.add(scene_token)
            break

scene_names = list()
for scene_token in scene_tokens:
    scene = nusc.get('scene', scene_token)
    scene_names.append(scene['name'])
assert len(scene_names) == len(scene_tokens)

print(scene_names)

Once you have the scene names, you can figure out which blobs they belong to using the code snippet here: #980 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants