sovit-123 / fasterrcnn-pytorch-training-pipeline

PyTorch Faster R-CNN Object Detection on Custom Dataset
MIT License
223 stars 75 forks source link

Eror testing with Vidio inference_video.py #73

Open WawanFirgiawan opened 1 year ago

WawanFirgiawan commented 1 year ago

I will testing model using fasterrcnn_resnet50_fpn_2 and I found an error in my program like the following:

Building from model name arguments... Downloading: "https://download.pytorch.org/models/fasterrcnn_resnet50_fpn_coco-258fb6c6.pth" to /root/.cache/torch/hub/checkpoints/fasterrcnn_resnet50_fpn_coco-258fb6c6.pth 100% 160M/160M [00:03<00:00, 52.4MB/s] Frame: 1, Forward pass FPS: 0.820, Forward pass time: 1.220 seconds, Forward pass + annotation time: 1.226 seconds qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.10/dist-packages/cv2/qt/plugins" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

WawanFirgiawan commented 1 year ago

I tested using google colabs. Please give me information in the topic eror.

sovit-123 commented 1 year ago

@WawanFirgiawan I think the error is due to opencv-python-headless and opencv-python. Can you please do: pip uninstall opencv-python pip install opencv-python-headless

And please do not pass --show argument to the inference command on Colab. OpenCV does not support OpenCV visualization.

WawanFirgiawan commented 1 year ago

how can i do the test in realtime?

sovit-123 commented 1 year ago

Hello, if you are asking for more than 24 FPS inference on videos, then you will need a powerful GPU. But you can also opt for smaller models in the library to get real-time FPS even on medium-range GPUs.