MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / _prepare_output_path

Function _prepare_output_path

detrsmpl/core/visualization/visualize_keypoints2d.py:239–257  ·  view source on GitHub ↗

Prepare output path.

(output_path, overwrite)

Source from the content-addressed store, hash-verified

237
238
239def _prepare_output_path(output_path, overwrite):
240 """Prepare output path."""
241 prepare_output_path(output_path,
242 allowed_suffix=['.mp4', ''],
243 tag='output video',
244 path_type='auto',
245 overwrite=overwrite)
246 # output_path is a directory
247 if check_path_suffix(output_path, ['']):
248 temp_folder = output_path
249 os.makedirs(temp_folder, exist_ok=True)
250 else:
251 temp_folder = output_path + '_temp_images'
252 if check_path_existence(temp_folder, 'dir') in [
253 Existence.DirectoryExistNotEmpty, Existence.DirectoryExistEmpty
254 ]:
255 shutil.rmtree(temp_folder)
256 os.makedirs(temp_folder, exist_ok=True)
257 return temp_folder
258
259
260def _check_frame_path(frame_list):

Callers 1

visualize_kp2dFunction · 0.85

Calls 3

prepare_output_pathFunction · 0.90
check_path_suffixFunction · 0.90
check_path_existenceFunction · 0.90

Tested by

no test coverage detected