liqian hace 1 año
padre
commit
e0afcfa95f
Se han modificado 2 ficheros con 11 adiciones y 2 borrados
  1. 5 1
      ai_tag_task.py
  2. 6 1
      asr_task.py

+ 5 - 1
ai_tag_task.py

@@ -206,7 +206,11 @@ def timer_check():
         data_count = data_check(project=project, table=table, dt=dt)
         if data_count > 0:
             print(f'videos count = {data_count}')
-            # 数据准备好,进行视频下载
+            asr_folder = 'asr_res'
+            if not os.path.exists(asr_folder):
+                # 1分钟后重新检查
+                Timer(60, timer_check).start()
+            # 数据准备好,进行aiTag
             ai_tags_new(project=project, table=table, dt=dt)
             print(f"videos ai tag finished!")
 

+ 6 - 1
asr_task.py

@@ -117,7 +117,12 @@ def timer_check():
         data_count = data_check(project=project, table=table, dt=dt)
         if data_count > 0:
             print(f'videos count = {data_count}')
-            # 数据准备好,进行视频下载
+            download_folder = 'videos'
+            download_folder = f'{download_folder}_{cuda_id}'
+            if not os.path.exists(download_folder):
+                # 视频未下载好,1分钟后重新检查
+                Timer(60, timer_check).start()
+            # 数据准备好,进行asr
             asr_process(project=project, table=table, dt=dt, cuda_id=cuda_id)
             print(f"videos asr finished!")