GFPGAN icon indicating copy to clipboard operation
GFPGAN copied to clipboard

Improve inference time.

Open rohaantahir opened this issue 2 years ago • 11 comments

Hi, I love the work. I wanted to enhance the videos of containing facial images. To do that I am converting the video to frames and processing it one by one. I wanted to know if there any solution to improve the inferrence time, so that when a big video processed it can be processed efficiently.

P.S I have RTX 3090 and core i9 high end system.

rohaantahir avatar Feb 09 '23 09:02 rohaantahir

same issue here. For me, it took about 90ms to process an 120x160 image. I wonder if there is room for improvement.

p.s. I use RTX3060.

Wong-denis avatar Feb 17 '23 08:02 Wong-denis

Still waiting for someone to respond and guide.

rohaantahir avatar Mar 21 '23 15:03 rohaantahir

@rohaantahir you know that 90ms is fast, right? Gfpgan is so far one of the fastest (still) given quality

dearkafka avatar Mar 21 '23 15:03 dearkafka

Yeah that seems fast, but, in my system I am getting morethan 90ms could you please tell me you are using? I am using this command to execute.

python inference_gfpgan.py -i input_image -o outputPath -v 1.4 -s 2 --only_center_face --bg_upsampler none

rohaantahir avatar Mar 21 '23 15:03 rohaantahir

@rohaantahir , you can skip frames without faces.

JGooLaaR avatar Mar 21 '23 16:03 JGooLaaR

@JGooLaaR I am doing it I am using the video that has only faces in every frame already.

rohaantahir avatar Mar 21 '23 16:03 rohaantahir

@rohaantahir, do you know the specific bottleneck code region?

JGooLaaR avatar Mar 21 '23 16:03 JGooLaaR

I am getting this time for one image to restore of resolution 640X360.

image

rohaantahir avatar Mar 21 '23 16:03 rohaantahir

no I am trying to figure it out. Could you please help me out.

rohaantahir avatar Mar 21 '23 16:03 rohaantahir

@Wong-denis what configurations you are using can you please tell me? like which pytorch, and python version specifically you are using?

rohaantahir avatar Mar 21 '23 16:03 rohaantahir

@rohaantahir , you must use "Measure execution time of a function" way to find out what method is the bottleneck. Inside inference script.

JGooLaaR avatar Mar 21 '23 17:03 JGooLaaR