AnomalyDetectionCVPR2018-Pytorch icon indicating copy to clipboard operation
AnomalyDetectionCVPR2018-Pytorch copied to clipboard

[QUESTION] feature extraction performance

Open tgcandido opened this issue 3 years ago • 2 comments

I would like to increase the performance of the feature extraction procedure. Currently, I'm generating clips from several streams and using the video_loader.py implementation (without the GUI) to perform inference with the C3D trained feature extractor + model. The problem is that for a 2 min clip, in my RTX 2060, it's taking around 55 seconds to complete the entire process (feature extraction + anomaly detection) with the num_worker parameter set to 8.

Is there an alternative? Maybe using torch serve? I would like to perform this process as fast as possible since I will use a pool of machines with GPUs to infer the videos generated by several hundred cameras in near-real time.

Thanks

tgcandido avatar Aug 23 '22 03:08 tgcandido

I would suggest trying torch's DataParallel or DistributedDataParallel. However, I'm a bit out of context of the purpose. Are you just trying to extract features, without making predictions?

ekosman avatar Aug 24 '22 15:08 ekosman

Oh, that's great! Thank you, I will give it a shot. I'm extracting the features and making predictions for each clip. To do a prediction for a clip takes about 0.005s, so that's why my concern is the feature extraction process.

tgcandido avatar Aug 24 '22 17:08 tgcandido