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-06-03 17:44:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f9cf7d24613c469e9084652bbdd07d71a6be8b6f
f9cf7d24
1 parent
4f51c651
jira:NYJ-1656 desc: modified live_videos_groups
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
18 deletions
src/football_replay_match/core/api.py
src/football_replay_match/core/utils/football_replay_match_live.py
src/football_replay_match/core/utils/llm_image.py
src/football_replay_match/core/api.py
View file @
f9cf7d2
...
...
@@ -72,7 +72,7 @@ class FootballReplayMatch:
else
:
# mp4_name = os.path.basename(os.path.dirname(os.path.dirname(os.path.dirname(video_url))))
mp4_name
=
os
.
path
.
basename
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
video_url
)))
return
self
.
videoMatchLive
.
match_batch
(
replay
,
events
,
max_parallel
=
2
,
cache_dir
=
os
.
path
.
join
(
self
.
cache_dir
,
mp4_name
,
"events"
),
task_log_dir
=
os
.
path
.
join
(
self
.
task_log_dir
,
mp4_name
,
task_id
))
return
self
.
videoMatchLive
.
match_batch
(
replay
,
events
,
max_parallel
=
3
,
cache_dir
=
os
.
path
.
join
(
self
.
cache_dir
,
mp4_name
,
"events"
),
task_log_dir
=
os
.
path
.
join
(
self
.
task_log_dir
,
mp4_name
,
task_id
))
def
replay_match_event
(
self
,
data
):
"""
...
...
src/football_replay_match/core/utils/football_replay_match_live.py
View file @
f9cf7d2
...
...
@@ -207,17 +207,7 @@ class FootballReplayMatchLive:
end_time
=
time
.
time
()
logger
.
info
(
f
"match_once_invoke_cost_time:{end_time-start_time:.2f}seconds"
)
# print(100*"3")
# logger.info(f"match once invoke result: {result}")
# print(100*"4")
# try:
# result_json = json.loads(result)
# except json.JSONDecodeError:
# try:
# result_json = json.loads(result.replace("```json", "").replace("```", ""))
# except Exception as e:
# print("JSON解析失败:", result)
# raise e
if
result
.
strip
()
==
"null"
:
result_json
=
{
"video_id"
:
None
}
else
:
...
...
@@ -270,10 +260,8 @@ class FootballReplayMatchLive:
with
open
(
cache_path
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
return
json
.
loads
(
f
.
read
())
# 按照max_parallel对live_videos进行分组
live_videos_groups
=
[
live_videos
[
i
::
max_parallel
]
for
i
in
range
(
max_parallel
)]
# 过滤掉空的分组
live_videos_groups
=
[
g
for
g
in
live_videos_groups
if
g
]
# 将 live_videos 按照每 max_parallel 个进行顺序划分
live_videos_groups
=
[
live_videos
[
i
:
i
+
max_parallel
]
for
i
in
range
(
0
,
len
(
live_videos
),
max_parallel
)]
# 如果group 大于1 并且最后一个group 只有一个元素,将其唯一元素放入倒数第二个group,并删除最后一个group
if
len
(
live_videos_groups
)
>
1
and
len
(
live_videos_groups
[
-
1
])
==
1
:
live_videos_groups
[
-
2
]
.
append
(
live_videos_groups
[
-
1
][
0
])
...
...
src/football_replay_match/core/utils/llm_image.py
View file @
f9cf7d2
...
...
@@ -101,7 +101,6 @@ class Video2Frame:
if
cache_name
.
exists
():
logger
.
info
(
f
"use_cache: {cache_name}"
)
# return json.load(cache_name.open('r'))
with
cache_name
.
open
(
'r'
,
encoding
=
'utf-8'
)
as
f
:
return
json
.
load
(
f
)
else
:
...
...
@@ -137,7 +136,7 @@ class Video2Frame:
# json.dump(data, cache_name.open('w'), indent=4)
with
cache_name
.
open
(
'w'
,
encoding
=
'utf-8'
)
as
f
:
json
.
dump
(
data
,
f
,
indent
=
4
)
logger
.
info
(
f
"save_cache:
{cache_name}"
)
logger
.
info
(
f
"save_cache:{cache_name}"
)
end_time
=
time
.
time
()
logger
.
info
(
f
"to_frames_cost_time:{end_time - start_time:.2f}seconds"
)
return
data
...
...
Please
register
or
login
to post a comment