[Misc] Clean up processing logic (#37541)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -1913,22 +1913,32 @@ class Molmo2DummyInputsBuilder(BaseDummyInputsBuilder[Molmo2ProcessingInfo]):
|
||||
height: int,
|
||||
num_frames: int,
|
||||
num_videos: int,
|
||||
overrides: VideoDummyOptions | None = None,
|
||||
) -> list[VideoItem]:
|
||||
video = np.full((num_frames, height, width, 3), 255, dtype=np.uint8)
|
||||
videos = super()._get_dummy_videos(
|
||||
width=width,
|
||||
height=height,
|
||||
num_frames=num_frames,
|
||||
num_videos=num_videos,
|
||||
overrides=overrides,
|
||||
)
|
||||
videos = [v.copy() for v in videos]
|
||||
|
||||
video_items = []
|
||||
for i in range(num_videos):
|
||||
for video in videos:
|
||||
video_num_frames = video.shape[0]
|
||||
video_metadata = {
|
||||
"fps": 2.0,
|
||||
"duration": num_frames / 2.0,
|
||||
"total_num_frames": num_frames,
|
||||
"frames_indices": list(range(num_frames)),
|
||||
"duration": video_num_frames / 2.0,
|
||||
"total_num_frames": video_num_frames,
|
||||
"frames_indices": list(range(video_num_frames)),
|
||||
"video_backend": "decord",
|
||||
"do_sample_frames": False,
|
||||
"height": height,
|
||||
"width": width,
|
||||
}
|
||||
video_item = (video.copy(), video_metadata)
|
||||
video_items.append(video_item)
|
||||
video_items.append((video, video_metadata))
|
||||
|
||||
return video_items
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user