amazon-science / bigdetection

BigDetection: A Large-scale Benchmark for Improved Object Detector Pre-training
Apache License 2.0
390 stars 24 forks source link

any demo script? #10

Open Kenneth-X opened 2 years ago

Kenneth-X commented 2 years ago

Is there any demo script to inference one single image and visualize? like https://github.com/open-mmlab/mmdetection/blob/master/demo/image_demo.py

bryanyzhu commented 2 years ago

There is a demo folder contributed in https://github.com/amazon-research/bigdetection/tree/main/demo

Kenneth-X commented 2 years ago

i followed the install instruction ,which is :

# Install Pytorch
conda install pytorch==1.8.0 torchvision==0.9.0 cudatoolkit=10.2 -c pytorch

# Install mmcv
pip install mmcv-full==1.3.9 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.8.0/index.html

# Clone and install
git clone https://github.com/amazon-research/bigdetection.git
cd bigdetection
pip install -r requirements/build.txt
pip install -v -e .

but got the error:

Traceback (most recent call last):
  File "demo/image_demo.py", line 51, in <module>
    main(args)
  File "demo/image_demo.py", line 26, in main
    result = inference_detector(model, args.img)
  File "/home/xt.xie/workspace/project/dog_stroller/bigdetection/bigdetection/mmdet/apis/inference.py", line 121, in inference_detector
    test_pipeline = Compose(cfg.data.test.pipeline)
  File "/home/xt.xie/.conda/envs/mm/lib/python3.8/site-packages/mmcv/utils/config.py", line 47, in __getattr__
    raise ex
AttributeError: 'ConfigDict' object has no attribute 'test'
bryanyzhu commented 2 years ago

@cailk @JY-Qiao Given the demo script is contributed by you, can you help? Thank you.

sujeongkim commented 1 year ago

Any updates? I am having the same issue with "configs/BigDetection/cbnetv2/htc_cbv2_swin_base_giou_4conv1f_adamw_bigdet.py"

sujeongkim commented 1 year ago

Adding "test" to the "data" dictionary in the config file (link) seems working.

Replace lines 130-134 with this: data = dict( samples_per_gpu=samples_per_gpu, train=dict( pipeline=train_pipeline), test=dict( pipeline=test_pipeline) )

cailk commented 1 year ago

Adding "test" to the "data" dictionary in the config file (link) seems working.

Replace lines 130-134 with this: data = dict( samples_per_gpu=samples_per_gpu, train=dict( pipeline=train_pipeline), test=dict( pipeline=test_pipeline) )

Hi, sorry for the late reply! We have not met such an error in our local environment. It is great that adding a test configuration in "data" would solve this problem. Thank you for your helpful advice.