MCPcopy Create free account
hub / github.com/TMElyralab/MuseTalk / split_data

Function split_data

scripts/preprocess.py:162–175  ·  view source on GitHub ↗

Split video files into training and validation sets based on val_list_hdtf. Parameters: video_files (List[str]): A list of video file names. val_list_hdtf (List[str]): A list of validation file identifiers. Returns: (List[str], List[str]): A tuple containing the training a

(video_files: List[str], val_list_hdtf: List[str])

Source from the content-addressed store, hash-verified

160 print(f"Error extracting audio from {vid}: {e}")
161
162def split_data(video_files: List[str], val_list_hdtf: List[str]) -> (List[str], List[str]):
163 """
164 Split video files into training and validation sets based on val_list_hdtf.
165
166 Parameters:
167 video_files (List[str]): A list of video file names.
168 val_list_hdtf (List[str]): A list of validation file identifiers.
169
170 Returns:
171 (List[str], List[str]): A tuple containing the training and validation file lists.
172 """
173 val_files = [f for f in video_files if any(val_id in f for val_id in val_list_hdtf)]
174 train_files = [f for f in video_files if f not in val_files]
175 return train_files, val_files
176
177def save_list_to_file(file_path: str, data_list: List[str]) -> None:
178 """

Callers 1

generate_train_listFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected