MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / sort_frames

Function sort_frames

data/video_utils.py:93–96  ·  view source on GitHub ↗
(frame_paths)

Source from the content-addressed store, hash-verified

91
92
93def sort_frames(frame_paths):
94 # Extract filenames from each path and sort by their numeric part
95 jpg_paths = [p for p in frame_paths if p.lower().endswith('.jpg')]
96 return sorted(jpg_paths, key=lambda x: extract_frame_number(os.path.basename(x)))
97
98
99def read_frames_folder(video_path, num_frames, sample='rand', fix_start=None, min_num_frames=4):

Callers 1

read_frames_folderFunction · 0.85

Calls 1

extract_frame_numberFunction · 0.85

Tested by

no test coverage detected