open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
28.52k stars 9.29k forks source link

The question about fps benchmark, how to get the times per images? #11174

Open lijoe123 opened 7 months ago

lijoe123 commented 7 months ago

Hello, when i run the script: python -m torch.distributed.launch --nproc_per_node=1 --master_port=29500 tools/analysis_tools/benchmark.py /home/music/Downloads/mmdetection_old/work_dir/weed_faster/faster-rcnn_r50_fpn_2x_coco.py --checkpoint /home/music/Downloads/mmdetection_old/work_dir/weed_faster/epoch_24.pth --launcher pytorch I got the fps:412.2 batch/s , times per batch:2.4ms/batch, it is so fast that i don't know the output is right or not. image

And when i used the mmyolo, it only get fps:89.1img/s, times per image: 11.1ms/img image

So how i can get the times per imagesin the mmdetection? Thank you!

wangzhengji06 commented 7 months ago

Add --task inference when you run benchmark.py. The default task is dataloader, so the speed is fast.

lijoe123 commented 7 months ago

Thank you for your answer, when i add --task inference, it still had the problem: image @wangzhengji06