Skip to content

[Registry] How to properly load the registry ? #2621

Answered by sunjiahao1999
IdrissGo asked this question in Q&A
Discussion options

You must be logged in to vote
import numpy as np 
from mmdet3d.registry import DATASETS
from mmengine.registry import init_default_scope  # Add this function
import mmcv
import mmengine
import mmdet3d



if __name__ == '__main__':
    init_default_scope('mmdet3d')  # Add
    dataset_class_name = 'KittiDataset'
    data_path = "./data/kitti"
    info_prefix = "kitti"
    info_path = f'{info_prefix}_infos_train.pkl'

    dataset_cfg = dict(
        type=dataset_class_name, data_root=data_path, ann_file=info_path)

    if dataset_class_name == 'KittiDataset':
        back_args = None
        dataset_cfg.update(
            test_mode=False,
            data_prefix=dict(pts=f"velodyne_reduced"),
            modality=dict(
…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@sunjiahao1999
Comment options

Answer selected by IdrissGo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants