hasanirtiza / Pedestron

[Pedestron] Generalizable Pedestrian Detection: The Elephant In The Room. @ CVPR2021
https://openaccess.thecvf.com/content/CVPR2021/papers/Hasan_Generalizable_Pedestrian_Detection_The_Elephant_in_the_Room_CVPR_2021_paper.pdf
Apache License 2.0
687 stars 159 forks source link

Question from a newbie #55

Closed Ruzhuang closed 4 years ago

Ruzhuang commented 4 years ago

Hi! I want to use one of your pre-trained models to detect humans for a surveillance camera, can you please shed some light on how should I decide which pre-trained model and configuration file to use? Thanks a lot! I have been stuck on this question for days.

hasanirtiza commented 4 years ago

This is a good question. Since, you have mentioned that your target dataset is recorded from surveillance camera, I would opt for the pre-trained model on Wider Pedestrian dataset. Since, Wider Pedestrian dataset contain images from both domains, 1) surveillance and 2) autonomous driving. Therefore, I would download this pre-trained model on Wider Pedestrian dataset and place it in models_pretrained folder.

If I were you, as a first step, I would simply run the demo.py on few of my target images using above-pre trained model of Cascade-RCNN with the following command (see below). Assuming your sample images are in demo folder and you want to store your result (detections) in your result_demo folder.

python tools/demo.py configs/elephant/cityperson/cascade_hrnet.py ./models_pretrained/epoch_14.pth demo/ result_demo/ 

Inspect the resultant images visually in result_demo folder and see if they are reasonable. If yes, then we can move further.

Ruzhuang commented 4 years ago

Thanks a lot! I wanted to reply to you after trying the suggestion you gave, but I just couldn't get CUDA installed on my mac laptop or raspberry pi. Is it true that your models cannot run on mac or raspberry pi because of CUDA or is there a way that I don't know? Thanks!!

hasanirtiza commented 4 years ago

Hard to comment, Pedestron requires GPU. #47

Ruzhuang commented 4 years ago

Hi again! I've learned that CUDA is often used for accelerating "computation-heavy" programs, so I was guessing that maybe pedestron only use CUDA for training models, and maybe using your pre-trained models on detection does not require CUDA theoretically. (If this is wrong please tell me and ignore next paragraph)

So I tried to run: conda run python tools/demo.py configs/elephant/cityperson/cascade_hrnet.py ./CascadeRCNNCP_model.pth.stu demo/ result_demo/ without CUDA installed. But I got the error: ImportError: cannot import name 'deform_conv_cuda' from 'mmdet.ops.dcn' (/Users/apple/Pedestron/tools/../mmdet/ops/dcn/__init__.py) Is this error something that I can avoid?

I really appreciate all your replies. They helped me a lot in learning this new topic.

hasanirtiza commented 4 years ago

In theory, you should be able to run inference on CPU. Personally, I have not tried it. However, just quick search on the issues of mmdetection repo retrieved 2 interesting hits. Perhaps you can have a look if you are interested in running CPU-only test.
here and install with cpu only (this one seems good).

As far as the error is concerned, to me these are functionalities which are dependent on CUDA and now without CUDA system is messing up, also, if you look at the second link I provide, it says that without CUDA certain functionalities are gone which includes Deformable Convolution.

Finally, another thing that might be useful for you is, if you are running into dead ends, have a look at the issues of mmdetection and put some keywords in the search (e.g cpu only, demo with cpu etc.), more often than not you will find something useful.

Hope that helps.