ming 3 rokov pred
rodič
commit
13e92da1a4
2 zmenil súbory, kde vykonal 6 pridanie a 4 odobranie
  1. 2 1
      main.py
  2. 4 3
      util/swap_face.py

+ 2 - 1
main.py

@@ -113,7 +113,8 @@ async def progress_page():
 async def swapFace(req:swap_req):
     sf = swap_face(req.imgurl)
     result = sf.run()
-    notify_group(result)
+    #notify_group(result)
+    
 
 @app.post("/make_anchor_video_v2")
 async def make_anchor_video_v2(req:request):

+ 4 - 3
util/swap_face.py

@@ -8,10 +8,11 @@ class swap_face():
         name_hash = str(time.time()).replace('.','')
         src_img = 'FaceSwap/src_img/'+name_hash+'.jpg'
         sv_path = '../html/swap_save'+name_hash+'.avi'
+        im = Image.open(requests.get(self.imgurl, stream=True).raw)
+        im= im.convert("RGB")
+        im.save(src_img)
         try:
-            im = Image.open(requests.get(self.imgurl, stream=True).raw)
-            im= im.convert("RGB")
-            im.save(src_img)
+            return 'asd'
         except:
             return '圖片錯誤'