From 48742826420e786266593252179a6ad94c3b7d48 Mon Sep 17 00:00:00 2001
From: KRSHH <136873090+KRSHH@users.noreply.github.com>
Date: Fri, 8 Nov 2024 23:21:30 +0530
Subject: [PATCH 1/4] Making issue template mandatory
---
.github/ISSUE_TEMPLATE/bug_report.md | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index a6701948..c61ccfaa 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,18 +1,8 @@
-[Remove this]The issue would most likely be diagnosed if you follow the template and give all the info.
+***[Remove this]The issue would be closed without notice and be considered spam if the template is not followed.***
**Describe the bug**
A clear and concise description of what the bug is.
-**To Reproduce**
-Steps to reproduce the behavior:
-1. Go to '...'
-2. Click on '....'
-3. Scroll down to '....'
-4. See error
-
-**Expected behavior**
-A clear and concise description of what you expected to happen.
-
**Screenshots**
If applicable, add screenshots to help explain your problem.
From a84098615930c9f937486214b1ea20c85803b42d Mon Sep 17 00:00:00 2001
From: NeuroDonu <112660822+NeuroDonu@users.noreply.github.com>
Date: Sat, 9 Nov 2024 16:43:13 +0300
Subject: [PATCH 2/4] fix path for model
---
modules/processors/frame/face_enhancer.py | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/modules/processors/frame/face_enhancer.py b/modules/processors/frame/face_enhancer.py
index d714fdbe..7874e35c 100644
--- a/modules/processors/frame/face_enhancer.py
+++ b/modules/processors/frame/face_enhancer.py
@@ -11,7 +11,6 @@
from modules.typing import Frame, Face
from modules.utilities import (
conditional_download,
- resolve_relative_path,
is_image,
is_video,
)
@@ -21,9 +20,11 @@
THREAD_LOCK = threading.Lock()
NAME = "DLC.FACE-ENHANCER"
+abs_dir = os.path.dirname(os.path.abspath(__file__))
+models_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(abs_dir))), 'models')
def pre_check() -> bool:
- download_directory_path = resolve_relative_path("..\models")
+ download_directory_path = models_dir
conditional_download(
download_directory_path,
[
@@ -47,11 +48,7 @@ def get_face_enhancer() -> Any:
with THREAD_LOCK:
if FACE_ENHANCER is None:
- if os.name == "nt":
- 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")
+ model_path = os.path.join(models_dir, 'GFPGANv1.4.pth')
FACE_ENHANCER = gfpgan.GFPGANer(model_path=model_path, upscale=1) # type: ignore[attr-defined]
return FACE_ENHANCER
From e4761e4d6602749c8a6f7f7eb10f2f2ac37ac38f Mon Sep 17 00:00:00 2001
From: NeuroDonu <112660822+NeuroDonu@users.noreply.github.com>
Date: Sat, 9 Nov 2024 16:43:35 +0300
Subject: [PATCH 3/4] fix path for download and use model
---
modules/processors/frame/face_swapper.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/processors/frame/face_swapper.py b/modules/processors/frame/face_swapper.py
index 0c7d88c1..cfe2147c 100644
--- a/modules/processors/frame/face_swapper.py
+++ b/modules/processors/frame/face_swapper.py
@@ -10,19 +10,21 @@
from modules.typing import Face, Frame
from modules.utilities import (
conditional_download,
- resolve_relative_path,
is_image,
is_video,
)
from modules.cluster_analysis import find_closest_centroid
+import os
FACE_SWAPPER = None
THREAD_LOCK = threading.Lock()
NAME = "DLC.FACE-SWAPPER"
+abs_dir = os.path.dirname(os.path.abspath(__file__))
+models_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(abs_dir))), 'models')
def pre_check() -> bool:
- download_directory_path = resolve_relative_path("../models")
+ download_directory_path = abs_dir
conditional_download(
download_directory_path,
[
@@ -54,7 +56,7 @@ def get_face_swapper() -> Any:
with THREAD_LOCK:
if FACE_SWAPPER is None:
- model_path = resolve_relative_path("../models/inswapper_128_fp16.onnx")
+ model_path = os.path.join(models_dir, 'inswapper_128_fp16.onnx')
FACE_SWAPPER = insightface.model_zoo.get_model(
model_path, providers=modules.globals.execution_providers
)
From cab8b9afcbde40fea132817d9133d8ed04be3d58 Mon Sep 17 00:00:00 2001
From: Kenneth Estanislao
+ ## Disclaimer This software is intended as a productive contribution to the AI-generated media industry. It aims to assist artists with tasks like animating custom characters or using them as models for clothing, etc.