PingoLH / FCHarDNet

Fully Convolutional HarDNet for Segmentation in Pytorch
MIT License
195 stars 52 forks source link

Low GPU usage and low FPS. #49

Open sieuwe1 opened 3 years ago

sieuwe1 commented 3 years ago

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

cao-nv commented 3 years ago

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