Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微调模型时的视频读取方式 #861

Open
ChenJian7578 opened this issue Jan 16, 2025 · 5 comments
Open

微调模型时的视频读取方式 #861

ChenJian7578 opened this issue Jan 16, 2025 · 5 comments

Comments

@ChenJian7578
Copy link

d2de2835537b9d55e3378ecc8ac0a55 图中绿色箭头处的视频读取方式还有别的实现吗,我发现在训练视频chat时,官方提供的方式会报错
@lll2343
Copy link
Collaborator

lll2343 commented Jan 16, 2025

可以看#617, 用视频推理时使用的load_video函数

@ChenJian7578
Copy link
Author

11a3334dbfffc3aa8dd6419e3d61633 我可以理解为将上图中左边橙色框的值替换为右边橙色框的值吗

@lll2343
Copy link
Collaborator

lll2343 commented Jan 16, 2025

Hi,

看Datasetset类,tsc_loader是一个封装类,从对象存储或者本地读取文件,可以直接调用里面的read_frames_decord方法,不要's3://'的部分(从对象存储读取文件),把petrel_client的部分都不要,就OK啦
read_frames_decord

返回的和直接从tcs_loader返回是一样的

def read_frames_decord(
        video_path, num_frames, sample='rand', fix_start=None,
        client=None, clip=None, min_num_frames=4
):
    # if 's3://' in video_path:
      #  video_bytes = client.get(video_path)
      #   video_reader = VideoReader(io.BytesIO(video_bytes), num_threads=1)
    else:
  # 用这个,
        video_reader = VideoReader(video_path, num_threads=1)
    vlen = len(video_reader)
    fps = video_reader.get_avg_fps()
    duration = vlen / float(fps)
    ....

@ChenJian7578
Copy link
Author

谢谢,已经可以了,视频最大支持32帧是吗

@lll2343
Copy link
Collaborator

lll2343 commented Jan 17, 2025

最大可以到64 frame

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants