Explorar o código

add swap face test

ming %!s(int64=3) %!d(string=hai) anos
pai
achega
b60120d440
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      util/swap_face.py

+ 4 - 4
util/swap_face.py

@@ -9,11 +9,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:
-            return 'asd'
+            im = Image.open(requests.get(self.imgurl, stream=True).raw)
+            im= im.convert("RGB")
+            im.save(src_img)
         except:
             return '圖片錯誤'