|
@@ -178,13 +178,25 @@ def gen_video(name_hash,name,text_content, image_urls,avatar,client_id):
|
|
|
|
|
|
|
|
|
def gen_avatar(name_hash, imgurl):
|
|
|
- c = rpyc.connect("localhost", 8868)
|
|
|
- c._config['sync_request_timeout'] = None
|
|
|
- remote_svc = c.root
|
|
|
- my_answer = remote_svc.call_avatar(name_hash,imgurl) # method call
|
|
|
-
|
|
|
- shutil.copy(tmp_avatar_dir+name_hash+'.mp4',avatar_dest+name_hash+'.mp4')
|
|
|
- os.remove(tmp_avatar_dir+name_hash+'.mp4')
|
|
|
+ while True:
|
|
|
+
|
|
|
+ directory= os.listdir('../../face_swap/tmp_avatar/')
|
|
|
+ if len(directory) == 0 and not os.path.isdir('../../face_swap/queueFlag'):
|
|
|
+ os.mkdir('../../face_swap/queueFlag')
|
|
|
+ c = rpyc.connect("localhost", 8868)
|
|
|
+ c._config['sync_request_timeout'] = None
|
|
|
+ remote_svc = c.root
|
|
|
+ my_answer = remote_svc.call_avatar(name_hash,imgurl) # method call
|
|
|
+
|
|
|
+ shutil.copy(tmp_avatar_dir+name_hash+'.mp4',avatar_dest+name_hash+'.mp4')
|
|
|
+ os.remove(tmp_avatar_dir+name_hash+'.mp4')
|
|
|
+ shutil.rmtree('../../face_swap/queueFlag')
|
|
|
+ else:
|
|
|
+ break
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|