Toggle navigation
Toggle navigation
This project
Loading...
Sign in
lizhengwei
/
aigc-embedding-service
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
lizhengwei
2026-05-18 17:12:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b6bd61f9eadc8b70a6ff2e7925f45fc7a9ed39f0
b6bd61f9
1 parent
d5719ab2
jira:NYJ-1540 desc: update api.py
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
19 deletions
src/football_replay_match/core/api.py
src/football_replay_match/core/api.py
View file @
b6bd61f
...
...
@@ -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
...
...
Please
register
or
login
to post a comment