mirror of
https://github.com/hacksider/Deep-Live-Cam.git
synced 2025-12-09 04:21:41 +01:00
solve the FACE_ENHANCER os problem for non-nt(linux, mac) system
This commit is contained in:
@@ -2,6 +2,7 @@ from typing import Any, List
|
|||||||
import cv2
|
import cv2
|
||||||
import threading
|
import threading
|
||||||
import gfpgan
|
import gfpgan
|
||||||
|
import os
|
||||||
|
|
||||||
import modules.globals
|
import modules.globals
|
||||||
import modules.processors.frame.core
|
import modules.processors.frame.core
|
||||||
@@ -34,8 +35,11 @@ def get_face_enhancer() -> Any:
|
|||||||
|
|
||||||
with THREAD_LOCK:
|
with THREAD_LOCK:
|
||||||
if FACE_ENHANCER is None:
|
if FACE_ENHANCER is None:
|
||||||
model_path = resolve_relative_path('..\models\GFPGANv1.4.pth')
|
if os.name == 'nt':
|
||||||
# todo: set models path https://github.com/TencentARC/GFPGAN/issues/399
|
model_path = resolve_relative_path('..\models\GFPGANv1.4.pth')
|
||||||
|
# todo: set models path https://github.com/TencentARC/GFPGAN/issues/399
|
||||||
|
else:
|
||||||
|
model_path = resolve_relative_path('../models/GFPGANv1.4.pth')
|
||||||
FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1) # type: ignore[attr-defined]
|
FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1) # type: ignore[attr-defined]
|
||||||
return FACE_ENHANCER
|
return FACE_ENHANCER
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user