Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,7 +42,7 @@ class Predictor:
|
|
| 42 |
return None
|
| 43 |
|
| 44 |
def predict(self, input_image_path, swap_image_path):
|
| 45 |
-
"""
|
| 46 |
try:
|
| 47 |
frame = cv2.imread(input_image_path)
|
| 48 |
face = self.get_face(frame)
|
|
@@ -50,7 +50,7 @@ class Predictor:
|
|
| 50 |
try:
|
| 51 |
print(frame.shape, face.shape, source_face.shape)
|
| 52 |
except:
|
| 53 |
-
print("
|
| 54 |
result = self.face_swapper.get(frame, face, source_face, paste_back=True)
|
| 55 |
|
| 56 |
_, _, result = self.face_enhancer.enhance(
|
|
@@ -67,7 +67,7 @@ class Predictor:
|
|
| 67 |
|
| 68 |
# Instantiate the Predictor class
|
| 69 |
predictor = Predictor()
|
| 70 |
-
title = "
|
| 71 |
|
| 72 |
# Create Gradio Interface
|
| 73 |
iface = gr.Interface(
|
|
|
|
| 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)
|
|
|
|
| 50 |
try:
|
| 51 |
print(frame.shape, face.shape, source_face.shape)
|
| 52 |
except:
|
| 53 |
+
print("⚙️ printing shapes failed.")
|
| 54 |
result = self.face_swapper.get(frame, face, source_face, paste_back=True)
|
| 55 |
|
| 56 |
_, _, result = self.face_enhancer.enhance(
|
|
|
|
| 67 |
|
| 68 |
# Instantiate the Predictor class
|
| 69 |
predictor = Predictor()
|
| 70 |
+
title = "🧸 Auto adjust Models 🧸"
|
| 71 |
|
| 72 |
# Create Gradio Interface
|
| 73 |
iface = gr.Interface(
|