lizhengwei

jira:NYJ-1540 desc: update api.py

... ... @@ -32,11 +32,11 @@ class FootballReplayMatch:
return None
def det_goal_replay(self, replay):
return self.videoEventRecognition.video_event(replay, cache_path=self.cache_dir)
return self.videoEventRecognition.video_event(replay, cache_dir=self.cache_dir)
def match_by_llm(self, replay, events):
return self.videoMatchLive.match_batch(replay, events, max_parallel=2, cache_path=self.cache_dir)
return self.videoMatchLive.match_batch(replay, events, max_parallel=2, cache_dir=self.cache_dir)
def replay_match_event(self, data):
"""
... ... @@ -62,6 +62,8 @@ class FootballReplayMatch:
"""
task_id = data.get("id")
match_id = data.get("match_id")
replay_id = replay_info.get('id')
matched_event_id = None
# 该时间段附近是否有进球事件
replay_info = data['replay']
... ... @@ -78,26 +80,16 @@ class FootballReplayMatch:
if matched_event is None:
logger.info(f"{task_id}_LLM认为视频{replay_info['url']}_{replay_info['start_utc']}_{replay_info['end_utc']} 是进球但是未能找到匹配的事件")
else:
replay_id = replay_info.get('id')
matched_event_id = matched_event.get('video_id')
logger.info(f"{task_id}_LLM认为视频{replay_info['url']}_{replay_info['start_utc']}_{replay_info['end_utc']} 对应的进球的事件视频是{matched_event_id}")
return {
"id": task_id,
"match_id": match_id,
"replay_id": replay_id,
"event_id": matched_event_id,
}
else:
logger.info(f"{task_id}_LLM判断{replay_info['url']}_{replay_info['start_utc']}_{replay_info['end_utc']} 不是进球,无需匹配")
else:
logger.info(f'通过时间找到匹配的事件')
replay_id = replay_info.get('id')
matched_event_id = matched_event.get('id')
return {
"id": task_id,
"match_id": match_id,
"replay_id": replay_id,
"event_id": matched_event_id,
}
\ No newline at end of file
logger.info(f"{task_id}_通过时间找到匹配认为视频{replay_info['url']}_{replay_info['start_utc']}_{replay_info['end_utc']} 对应的进球的事件视频是{matched_event_id}")
return {
"id": task_id,
"match_id": match_id,
"replay_id": replay_id,
"event_id": matched_event_id
}
\ No newline at end of file
... ...