Bug 8030 - [ModelScope][容器镜像]默认未安装ffmpeg,导致通义实验室8个CV相关的官方模型无法直接运行
Summary: [ModelScope][容器镜像]默认未安装ffmpeg,导致通义实验室8个CV相关的官方模型无法直接运行
Status: NEW
Alias: None
Product: Anolis OS 8
Classification: Anolis OS
Component: Images&Installations (show other bugs) Images&Installations
Version: 8.8
Hardware: All Linux
: P3-Medium S2-major
Target Milestone: ---
Assignee: zhongling
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-24 10:51 UTC by bolong_tbl
Modified: 2024-01-24 10:51 UTC (History)
0 users

See Also:


Attachments
ffmpeg失败模型 (63.40 KB, image/png)
2024-01-24 10:51 UTC, bolong_tbl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bolong_tbl alibaba_cloud_group 2024-01-24 10:51:33 UTC
Created attachment 984 [details]
ffmpeg失败模型

Description of problem:
镜像默认未安装ffmpeg包,导致通义实验室8个CV相关的官方模型无法直接运行,ModelScope社区Ubuntu镜像默认安装了ffmpeg无该问题。

影响模型列表见附件,包括cv_raft_video-frame-interpolation等模型

Version-Release number of selected component (if applicable):
镜像地址:registry.openanolis.cn/openanolis/modelscope:1.10.0-an8


Steps to Reproduce:
1. 启动容器docker run -it registry.openanolis.cn/openanolis/modelscope:1.10.0-an8
2. 根据ModelScope官网,找到模型对应的代码范例(code example),以cv_raft_video-frame-interpolation为例:

from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from modelscope.outputs import OutputKeys

video = 'https://modelscope.oss-cn-beijing.aliyuncs.com/test/videos/video_frame_interpolation_test.mp4'
video_frame_interpolation_pipeline = pipeline(Tasks.video_frame_interpolation, 'damo/cv_raft_video-frame-interpolation')
result = video_frame_interpolation_pipeline(video)[OutputKeys.OUTPUT_VIDEO]
print('pipeline: the output video path is {}'.format(result))

3. 执行代码范例

Actual results:

以cv_raft_video-frame-interpolation为例,执行报错:
2024-01-23 13:09:13,206 - modelscope - INFO - load model done.
2024-01-23 13:09:13,209 - modelscope - WARNING - No preprocessor field found in cfg.
2024-01-23 13:09:13,209 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.
2024-01-23 13:09:13,209 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/root/.cache/modelscope/hub/damo/cv_raft_video-frame-interpolation'}. trying to build by task and model information.
2024-01-23 13:09:13,209 - modelscope - WARNING - No preprocessor key ('video-frame-interpolation', 'video-frame-interpolation') found in PREPROCESSOR_MAP, skip building preprocessor.
2024-01-23 13:09:13,252 - modelscope - INFO - load video frame-interpolation done
2024-01-23 13:09:13,264 - modelscope - WARNING - task video-frame-interpolation input definition is missing
sh: ffmpeg: command not found
Traceback (most recent call last):
  File "/cache/integration_tests/workspace/test_cv_raft_video-frame-interpolation.py", line 8, in 
    result = video_frame_interpolation_pipeline(video)[OutputKeys.OUTPUT_VIDEO]
  File "/opt/conda/lib/python3.8/site-packages/modelscope/pipelines/base.py", line 219, in __call__
    output = self._process_single(input, *args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/modelscope/pipelines/base.py", line 258, in _process_single
    out = self.postprocess(out, **postprocess_params)
  File "/opt/conda/lib/python3.8/site-packages/modelscope/pipelines/cv/video_frame_interpolation_pipeline.py", line 605, in postprocess
    assert os.system(
AssertionError: ffmpeg is not installed correctly!


备注:每个模型报错calltrace有差异,但最后均为ffmpeg的问题

Expected results:
执行不报错

Additional info:

ModelScope社区Ubuntu镜像(registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu22.04-cuda11.8.0-py310-torch2.1.0-tf2.14.0-1.10.0
)默认安装了ffmpeg

root@6610060b5bc0:/# conda list |grep ffmpeg
ffmpeg                    1.4                      pypi_0    pypi
ffmpeg-python             0.2.0                    pypi_0    pypi
imageio-ffmpeg            0.4.9              pyhd8ed1ab_0    conda-forge