|
@@ -2,6 +2,7 @@ import os
|
|
|
import shutil
|
|
|
import json
|
|
|
import datetime
|
|
|
+import sys
|
|
|
import time
|
|
|
import traceback
|
|
|
import requests
|
|
@@ -35,7 +36,7 @@ def get_asr(video_id, download_folder, asr_folder):
|
|
|
break
|
|
|
|
|
|
|
|
|
-def asr_process(project, table, dt):
|
|
|
+def asr_process(project, table, dt, cuda_id):
|
|
|
# 获取特征数据
|
|
|
feature_df = get_feature_data(project=project, table=table, dt=dt, features=features)
|
|
|
video_id_list = feature_df['videoid'].to_list()
|
|
@@ -49,6 +50,7 @@ def asr_process(project, table, dt):
|
|
|
video_info[video_id] = {'title': title}
|
|
|
# 获取已下载视频,做asr识别
|
|
|
download_folder = 'videos'
|
|
|
+ download_folder = f'{download_folder}_{cuda_id}'
|
|
|
asr_folder = 'asr_res'
|
|
|
if not os.path.exists(asr_folder):
|
|
|
os.makedirs(asr_folder)
|
|
@@ -105,6 +107,7 @@ def asr_process(project, table, dt):
|
|
|
|
|
|
def timer_check():
|
|
|
try:
|
|
|
+ cuda_id = sys.argv[1]
|
|
|
project = config_.DAILY_VIDEO['project']
|
|
|
table = config_.DAILY_VIDEO['table']
|
|
|
now_date = datetime.datetime.today()
|
|
@@ -115,7 +118,7 @@ def timer_check():
|
|
|
if data_count > 0:
|
|
|
print(f'videos count = {data_count}')
|
|
|
# 数据准备好,进行视频下载
|
|
|
- asr_process(project=project, table=table, dt=dt)
|
|
|
+ asr_process(project=project, table=table, dt=dt, cuda_id=cuda_id)
|
|
|
print(f"videos asr finished!")
|
|
|
|
|
|
else:
|