zhangxiaosong18 / FreeAnchor

FreeAnchor: Learning to Match Anchors for Visual Object Detection (NeurIPS 2019)
https://arxiv.org/abs/1909.02466
MIT License
677 stars 111 forks source link

CPU usage goes too high when running demo/webcam.py #21

Closed lqzhao closed 4 years ago

lqzhao commented 4 years ago

image it costs too much cpu resources when I run demo/webcom.py. It almost occupied all cpus, which makes other program has no cpu resources available. However, it doesn't happen while training or testing. I wonder why it cost so much cpu resource and how can I fix this problem?

I modified the code of webcom.py to make a single image as input.

123wk45678 commented 4 years ago

do you meet this problem? ImportError: cannot import name '_C'

123wk45678 commented 4 years ago

how to solve it?

lqzhao commented 4 years ago

how to solve it?

You can just force the program to use single thread as follows: torch.set_num_threads(1) This command can reduce CPU usage effectively with little effect on the speed of inference.

lqzhao commented 4 years ago

ImportError: cannot import name '_C'

Check your environment. Follow the instructions the author provided.

yustaub commented 4 years ago

@lqzhao there are some mistake happened when i run demo on single image, I change the video stream into image in code, and there are some error , can u share your demo code?thank u so much!!

lqzhao commented 4 years ago

@lqzhao there are some mistake happened when i run demo on single image, I change the video stream into image in code, and there are some error , can u share your demo code?thank u so much!!

Leave your email. I'll find that code then send it to you.

yustaub commented 4 years ago

@lqzhao 1034397129@qq.com, thank you so much!!!

lqzhao commented 4 years ago

@lqzhao 1034397129@qq.com, thank you so much!!!

check it.

yustaub commented 4 years ago

@lqzhao 1034397129@qq.com, thank you so much!!!

check it.

ok, thanks!