OlafenwaMoses / ImageAI

A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
https://www.genxr.co/#products
MIT License
8.63k stars 2.19k forks source link

prediction_speed for Detector ? #413

Open raghavgurbaxani opened 4 years ago

raghavgurbaxani commented 4 years ago

Hi Thank you for the amazing work on this project.

While setting the prediction_speed parameter for loadModel() for a detector Yolov3, I get the error -

loadModel() got unexpected keyword argument 'prediction_speed'

Is the prediction speed only valid for classification models and not object detectors yet ?

P.S. I am using a Custom Object Detector fine tuned on my dataset as from the tutorial here

OlafenwaMoses commented 4 years ago

The imageai.Detection.ObjectDetection class supports detection_speed when you load a model.

However, detection speed is yet to be supported for imageai.Detection.Custom.CustomObjectDetection .

LilianLiang7 commented 4 years ago

As far as I know, the detection_speed in imageai.Detection.ObjectDetection class only changes the image size, right? Is there any other way to improve the detection speed? I am running the model on CPU (with 40 cores) and hope to achieve online detect effect for videos, but the detection speed now is only around 4 FPS, Can it be improved?

golemme2 commented 4 years ago

I'm trying to use imageai 2.1.5 for yolov3 detection (NOT custom), but it takes 4 seconds to process one 1280 x 852 image on a PC with 32 GB RAM, a GTX 1060 6 GB GPU, CUDA 10.0, and tensflow-gpu 1.15 installed. Performing the same detection using just the CPU and OpenCV takes just 1 second. When I pass prediction_speed=fast to loadModel(), I get an error message: "loadModel() got an unexpected keyword argument 'prediction_speed'".