Process GFPGANer on cuda:0 when possible, otherwise use cpu.

This commit is contained in:
Marc-Andre Ferland 2022-10-16 23:12:46 -04:00
parent 1d4c5cc96f
commit d4a348a2b2

View File

@ -217,6 +217,7 @@ def thread_render(device):
if not queued_task.request.use_cpu and runtime.thread_data.device == 'cpu': if not queued_task.request.use_cpu and runtime.thread_data.device == 'cpu':
continue # CPU Tasks continue # CPU Tasks
if queued_task.request.use_face_correction and not runtime.is_first_cuda_device(runtime.thread_data.device): if queued_task.request.use_face_correction and not runtime.is_first_cuda_device(runtime.thread_data.device):
if not runtime.thread_data.device == 'cpu' and is_alive(0) > 0: # Allows GFPGANer on cuda:0 and use cpu only when cuda:0 is not available.
continue #TODO Remove when fixed - A bug with GFPGANer and facexlib needs to be fixed before use on other devices. continue #TODO Remove when fixed - A bug with GFPGANer and facexlib needs to be fixed before use on other devices.
task = queued_task task = queued_task
break break