FCHarDNet icon indicating copy to clipboard operation
FCHarDNet copied to clipboard

Low GPU usage and low FPS.

Open sieuwe1 opened this issue 5 years ago • 1 comments

Hi @PingoLH

I have changed test.py to run on a video. See implementation below:

device, model = init_model(args)
 proc_size = eval(args.size)

 cap = cv2.VideoCapture("/home/sieuwe/Downloads/Garmin Dash Cam 55 Video Sample (Highway) _ 1080p 30fps (HDR).mp4")

 while(True):

     begin = time.perf_counter()
     ret, frame = cap.read()
     img_raw, decoded = process_img(frame, proc_size, device, model)
     cv2.imshow("OUT",decoded)
     cv2.imshow("IN",img_raw)
     end = time.perf_counter()
     print("fps", 1 / (end - begin))

     if cv2.waitKey(1) & 0xFF == ord('q'):
         break

 cap.release()
 cv2.destroyAllWindows()

I am running a GTX1080 and thus expected a FPS of around 40. I however got a much lower fps of 21. When looking at my GPU util in nvidia-smi I see that it only uses 10% of my gpu. How can I increase the GPU util to get higher FPS.

Using CUDA 10.2 on Ubunut 18.04 with pytorch version 1.4.0

Thanks for your help

Sieuwe

sieuwe1 avatar Nov 02 '20 23:11 sieuwe1

Actually, the reported FPS was calculated with only the model time and post-processing time, not the entire pipeline.

cao-nv avatar Nov 24 '20 06:11 cao-nv