浏览代码

new swap face path modification

ming 3 年之前
父节点
当前提交
5ff9943509
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      api/main.py

+ 6 - 4
api/main.py

@@ -51,7 +51,7 @@ app.mount("/static", StaticFiles(directory="static"), name="static")
 app.mount("/static/img", StaticFiles(directory="static/img"), name="static/img")
 
 tmp_video_dir = '../OpenshotService/tmp_video/'
-tmp_avatar_dir = '../face_swap/tmp_avatar/'
+tmp_avatar_dir = '../../face_swap/tmp_avatar/'  #change source face path here
 video_sub_folder = 'ai_anchor_video/'
 avatar_sub_folder = 'swap_save/'
 tmp_img_sub_folder = 'tmp_img/'
@@ -167,8 +167,10 @@ def gen_avatar():
     c = rpyc.connect("localhost", 8868)
     c._config['sync_request_timeout'] = None
     remote_svc = c.root
-    my_answer = remote_svc.call_avatar(name_hash,name,text_content, image_urls,avatar,client_id) # method call
+    my_answer = remote_svc.call_avatar(name_hash) # method call
    
-    shutil.copy(tmp_video_dir+name_hash+'.mp4',video_dest+name_hash+'.mp4')
-    os.remove(tmp_video_dir+name_hash+'.mp4')
+    shutil.copy(tmp_avatar_dir+name_hash+'.mp4',avatar_dest+name_hash+'.mp4')
+    os.remove(tmp_avatar_dir+name_hash+'.mp4')
+
+