Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reopen #500

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions scripts/reactor_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,13 @@ def save_face_model(face: Face, filename: str) -> None:

def get_models():
global MODELS_PATH
models_path_init = os.path.join(models_path, "insightface/*")
models = glob.glob(models_path_init)
models_path_init = os.path.join(models_path, "insightface/**/*")
models = glob.glob(models_path_init, recursive=True)
models = [x for x in models if x.endswith(".onnx") or x.endswith(".pth")]
model_inswapper = os.path.join(models_path, "insightface/inswapper_128.onnx")
model_inswapper_lost = [path for path in models if 'inswapper_128.onnx' in path and os.path.split(path)[0].split('\\')[-1] != "insightface"]
if model_inswapper_lost and not os.path.exists(model_inswapper):
os.rename(model_inswapper_lost[0], model_inswapper)
models_names = []
for model in models:
model_path = os.path.split(model)
Expand Down