Save space by removing model dependency
This commit is contained in:
+4
-1
@@ -27,7 +27,10 @@ if not os.path.exists(model_path):
|
||||
|
||||
# Copy model to ./scripts/ using a hard link
|
||||
dst = os.path.join(os.path.dirname(os.path.realpath(__file__)), "scripts", model_name)
|
||||
os.link(model_path, dst)
|
||||
if not os.path.exists(dst):
|
||||
os.link(model_path, dst)
|
||||
else:
|
||||
print(f"Existing model found at {dst}, skipping hard link.")
|
||||
|
||||
print("Checking roop requirements")
|
||||
with open(req_file) as file:
|
||||
|
||||
@@ -2,5 +2,4 @@ insightface==0.7.3
|
||||
onnx==1.14.0
|
||||
onnxruntime==1.15.0
|
||||
opencv-python==4.7.0.72
|
||||
ifnude
|
||||
cython
|
||||
|
||||
+1
-6
@@ -1,9 +1,4 @@
|
||||
import tempfile
|
||||
from ifnude import detect
|
||||
|
||||
def convert_to_sd(img):
|
||||
shapes = []
|
||||
chunks = detect(img)
|
||||
for chunk in chunks:
|
||||
shapes.append(chunk["score"] > 0.7)
|
||||
return [any(shapes), tempfile.NamedTemporaryFile(delete=False, suffix=".png")]
|
||||
return [False, tempfile.NamedTemporaryFile(delete=False, suffix=".png")]
|
||||
|
||||
@@ -17,7 +17,6 @@ from scripts.swapper import UpscaleOptions, swap_face, ImageResult
|
||||
from scripts.roop_version import version_flag
|
||||
import os
|
||||
|
||||
|
||||
def get_models():
|
||||
models_path = os.path.join(scripts.basedir(), "models" + os.path.sep + "roop" + os.path.sep + "*")
|
||||
models = glob.glob(models_path)
|
||||
|
||||
Reference in New Issue
Block a user