Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xuwx1
LightX2V
Commits
b1e543f1
Commit
b1e543f1
authored
Jul 23, 2025
by
gaclove
Browse files
Refactor video frame interpolation documentation and error handling in model loading
parent
75eac23c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
20 deletions
+24
-20
docs/ZH_CN/source/method_tutorials/video_frame_interpolation.md
...H_CN/source/method_tutorials/video_frame_interpolation.md
+0
-1
lightx2v/models/runners/default_runner.py
lightx2v/models/runners/default_runner.py
+1
-1
tools/download_rife.py
tools/download_rife.py
+23
-18
No files found.
docs/ZH_CN/source/method_tutorials/video_frame_interpolation.md
View file @
b1e543f1
...
@@ -87,7 +87,6 @@ python lightx2v/infer.py \
...
@@ -87,7 +87,6 @@ python lightx2v/infer.py \
1.
`video_frame_interpolation.target_fps`
- 如果启用视频帧插值,使用此帧率作为输出帧率
1.
`video_frame_interpolation.target_fps`
- 如果启用视频帧插值,使用此帧率作为输出帧率
2.
`fps`
(默认 16)- 如果未启用视频帧插值,使用此帧率;同时总是用作源帧率
2.
`fps`
(默认 16)- 如果未启用视频帧插值,使用此帧率;同时总是用作源帧率
**注意**
: 系统不再使用
`video_fps`
配置项,统一使用
`video_frame_interpolation.target_fps`
来控制输出视频的帧率。
## 工作原理
## 工作原理
...
...
lightx2v/models/runners/default_runner.py
View file @
b1e543f1
...
@@ -56,7 +56,7 @@ class DefaultRunner(BaseRunner):
...
@@ -56,7 +56,7 @@ class DefaultRunner(BaseRunner):
logger
.
info
(
"Loading RIFE model..."
)
logger
.
info
(
"Loading RIFE model..."
)
return
RIFEWrapper
(
self
.
config
[
"video_frame_interpolation"
][
"model_path"
])
return
RIFEWrapper
(
self
.
config
[
"video_frame_interpolation"
][
"model_path"
])
else
:
else
:
raise
ValueError
(
f
"Unsupported VFI model:
{
self
.
config
[
'v
f
i'
]
}
"
)
raise
ValueError
(
f
"Unsupported VFI model:
{
self
.
config
[
'vi
deo_frame_interpolation'
][
'algo
'
]
}
"
)
@
ProfilingContext
(
"Load models"
)
@
ProfilingContext
(
"Load models"
)
def
load_model
(
self
):
def
load_model
(
self
):
...
...
tools/download_rife.py
View file @
b1e543f1
...
@@ -92,23 +92,6 @@ def main():
...
@@ -92,23 +92,6 @@ def main():
print
(
"Error: flownet.pkl file not found"
)
print
(
"Error: flownet.pkl file not found"
)
return
1
return
1
# Clean up temporary files
print
(
"Cleaning up temporary files..."
)
if
zip_path
.
exists
():
zip_path
.
unlink
()
print
(
f
"Deleted:
{
zip_path
}
"
)
# Delete extracted folders
for
item
in
temp_dir
.
iterdir
():
if
item
.
is_dir
():
shutil
.
rmtree
(
item
)
print
(
f
"Deleted directory:
{
item
}
"
)
# Delete the temp directory itself if empty
if
temp_dir
.
exists
()
and
not
any
(
temp_dir
.
iterdir
()):
temp_dir
.
rmdir
()
print
(
f
"Deleted temp directory:
{
temp_dir
}
"
)
print
(
"RIFE model download and installation completed!"
)
print
(
"RIFE model download and installation completed!"
)
return
0
return
0
...
@@ -116,11 +99,33 @@ def main():
...
@@ -116,11 +99,33 @@ def main():
print
(
f
"Error:
{
e
}
"
)
print
(
f
"Error:
{
e
}
"
)
return
1
return
1
finally
:
finally
:
# Clean up temporary files
print
(
"Cleaning up temporary files..."
)
# Delete zip file if exists
if
zip_path
.
exists
():
if
zip_path
.
exists
():
try
:
try
:
zip_path
.
unlink
()
zip_path
.
unlink
()
print
(
f
"Deleted:
{
zip_path
}
"
)
except
Exception
as
e
:
print
(
f
"Error deleting zip file:
{
e
}
"
)
# Delete extracted folders
for
item
in
temp_dir
.
iterdir
():
if
item
.
is_dir
():
try
:
shutil
.
rmtree
(
item
)
print
(
f
"Deleted directory:
{
item
}
"
)
except
Exception
as
e
:
print
(
f
"Error deleting directory
{
item
}
:
{
e
}
"
)
# Delete the temp directory itself if empty
if
temp_dir
.
exists
()
and
not
any
(
temp_dir
.
iterdir
()):
try
:
temp_dir
.
rmdir
()
print
(
f
"Deleted temp directory:
{
temp_dir
}
"
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
f
"Error:
{
e
}
"
)
print
(
f
"Error
deleting temp directory
:
{
e
}
"
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment