sandrocalzada commited on
Commit
9c29306
1 Parent(s): 3f80304

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -17,7 +17,7 @@ ONNX_SWAPPER_MODEL = 'inswapper_128.onnx'
17
  def face_swapper(image_background, image_customer):
18
  app = FaceAnalysis(name='buffalo_l')
19
  app.prepare(ctx_id=0, det_size=(640, 640))
20
- swapper = insightface.model_zoo.get_model(os.path.join(os.getcwd(), PATH_MODEL, ONNX_SWAPPER_MODEL), download=False)
21
  face_customer = app.get(image_customer)[0]
22
  faces = app.get(image_background)
23
 
@@ -27,7 +27,7 @@ def face_swapper(image_background, image_customer):
27
  return image_background
28
 
29
  def process(image):
30
- with open(os.path.join(os.getcwd(), PATH_MODEL, DATA_IMAGE_PICKLE), 'rb') as file:
31
  data_images = pickle.load(file)
32
 
33
  images_background_encoding, images_background_contents = data_images['encodings'], data_images['content']
 
17
  def face_swapper(image_background, image_customer):
18
  app = FaceAnalysis(name='buffalo_l')
19
  app.prepare(ctx_id=0, det_size=(640, 640))
20
+ swapper = insightface.model_zoo.get_model(os.path.join(os.getcwd(), ONNX_SWAPPER_MODEL), download=False)
21
  face_customer = app.get(image_customer)[0]
22
  faces = app.get(image_background)
23
 
 
27
  return image_background
28
 
29
  def process(image):
30
+ with open(os.path.join(os.getcwd(), DATA_IMAGE_PICKLE), 'rb') as file:
31
  data_images = pickle.load(file)
32
 
33
  images_background_encoding, images_background_contents = data_images['encodings'], data_images['content']