open-mmlab / mmtracking

OpenMMLab Video Perception Toolbox. It supports Video Object Detection (VID), Multiple Object Tracking (MOT), Single Object Tracking (SOT), Video Instance Segmentation (VIS) with a unified framework.
https://mmtracking.readthedocs.io/en/latest/
Apache License 2.0
3.56k stars 598 forks source link

VID,I want to train a model to detect only one class #729

Open AlfieXiong opened 2 years ago

AlfieXiong commented 2 years ago

step1,I design a config of datasets,that is configs/base/datasets/myDataset.py: dataset_type = 'CocoVideoDataset' data_root = '/home/datasets/airplane/' classes = ('airplane') step 2,I modify the number_classes in configs/base/models/faster_rcnn_r50_dc5.py in line 52: num_classes=1 step 3,then I train the model by running "python tools/train.py ./configs/vid/temporal_roi_align/selsa_troialign_faster_rcnn_r50_dc5_7e_imagenetvid.py --gpu-id 0" but it does not work

error: File "tools/train.py", line 185, in main datasets = [build_dataset(cfg.data.train)] File "/home/xiongp/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/mmdet/datasets/builder.py", line 63, in build_dataset dataset = ConcatDataset([build_dataset(c, default_args) for c in cfg]) File "/home/xiongp/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/mmdet/datasets/builder.py", line 63, in dataset = ConcatDataset([build_dataset(c, default_args) for c in cfg]) File "/home/xiongp/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/mmdet/datasets/builder.py", line 82, in build_dataset dataset = build_from_cfg(cfg, DATASETS, default_args) File "/home/xiongp/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/utils/registry.py", line 72, in build_from_cfg raise type(e)(f'{obj_cls.name}: {e}') FileNotFoundError: CocoVideoDataset: [Errno 2] No such file or directory: 'airplane'

I will appreciate for you help

Ziwei89 commented 1 year ago

Have you solved this problem? Thanks.

meikorol commented 1 year ago

HI,have you solved this?Could you please tell me how to make my own CocoVideoDataset?