modelscope / modelscope/DiffSynth-Studio

wan2.2 如果要训练首尾帧,是不是需要把训练数据变换到81帧以内,不然就被截断了

Open
#1,384 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13.1k
Forks
1.3k
Avg merge
13h 12m
Merged PRs (30d)
45

Description

class LoadVideo(DataProcessingOperator, FrameSamplerByRateMixin):
def init(self, num_frames=81, time_division_factor=4, time_division_remainder=1, frame_processor=lambda x: x, frame_rate=24, fix_frame_rate=False):
FrameSamplerByRateMixin.init(self, num_frames, time_division_factor, time_division_remainder, frame_rate, fix_frame_rate)
# frame_processor is build in the video loader for high efficiency.
self.frame_processor = frame_processor

def __call__(self, data: str):
    reader = self.get_reader(data)
    raw_frame_rate = reader.get_meta_data()['fps']
    num_frames = self.get_num_frames(reader)
    total_raw_frames = reader.count_frames()
    frames = []
    for frame_id in range(num_frames):
        frame_id = self.map_single_frame_id(frame_id, raw_frame_rate, total_raw_frames)
        frame = reader.get_data(frame_id)
        frame = Image.fromarray(frame)
        frame = self.frame_processor(frame)
        frames.append(frame)
    reader.close()
    return frames

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LoadVideo and trace FrameSamplerByRateMixin, especially get_num_frames and map_single_frame_id. Verify how videos longer than 81 frames are sampled and whether first/last-frame training data is truncated; done means documenting the behavior or defining the required handling for those inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.