Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -41,12 +41,12 @@ class Predictor:
|
|
41 |
print("No face found")
|
42 |
return None
|
43 |
|
44 |
-
def predict(self,
|
45 |
"""Run a single prediction on the model"""
|
46 |
try:
|
47 |
-
frame = cv2.imread(
|
48 |
face = self.get_face(frame)
|
49 |
-
source_face = self.get_face(cv2.imread(
|
50 |
try:
|
51 |
print(frame.shape, face.shape, source_face.shape)
|
52 |
except:
|
@@ -78,8 +78,8 @@ iface = gr.Interface(
|
|
78 |
],
|
79 |
outputs=gr.Image(type="filepath", label="Result"),
|
80 |
title=title,
|
81 |
-
examples=[["input.jpg", "swap img.jpg"]]
|
82 |
-
|
83 |
|
84 |
# Launch the Gradio Interface
|
85 |
iface.launch()
|
|
|
41 |
print("No face found")
|
42 |
return None
|
43 |
|
44 |
+
def predict(self, input_image_path, swap_image_path):
|
45 |
"""Run a single prediction on the model"""
|
46 |
try:
|
47 |
+
frame = cv2.imread(input_image_path)
|
48 |
face = self.get_face(frame)
|
49 |
+
source_face = self.get_face(cv2.imread(swap_image_path))
|
50 |
try:
|
51 |
print(frame.shape, face.shape, source_face.shape)
|
52 |
except:
|
|
|
78 |
],
|
79 |
outputs=gr.Image(type="filepath", label="Result"),
|
80 |
title=title,
|
81 |
+
examples=[["input.jpg", "swap img.jpg"]]
|
82 |
+
)
|
83 |
|
84 |
# Launch the Gradio Interface
|
85 |
iface.launch()
|