victorisgeek commited on
Commit
2576604
·
verified ·
1 Parent(s): f8f2937

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -41,12 +41,12 @@ class Predictor:
41
  print("No face found")
42
  return None
43
 
44
- def predict(self, input_image, swap_image):
45
  """Run a single prediction on the model"""
46
  try:
47
- frame = cv2.imread(input_image.name)
48
  face = self.get_face(frame)
49
- source_face = self.get_face(cv2.imread(swap_image.name))
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()