MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / check_path_exists

Function check_path_exists

lightx2v/utils/utils.py:705–717  ·  view source on GitHub ↗

Check if a file path exists and raise an error if it doesn't. Args: path: The file path to check Raises: FileNotFoundError: If the path is not empty and the file does not exist

(path: str)

Source from the content-addressed store, hash-verified

703 if orig_ratio > target_ratio:
704 crop_width = orig_width
705 crop_height = int(crop_width * target_ratio)
706 else:
707 crop_height = orig_height
708 crop_width = int(crop_height / target_ratio)
709
710 cropped_img = TF.center_crop(img, [crop_height, crop_width])
711
712 resized_img = TF.resize(cropped_img, [target_height, target_width], antialias=True)
713
714 h, w = resized_img.shape[-2:]
715 return resized_img, h, w
716
717
718def check_path_exists(path: str) -> None:
719 """
720 Check if a file path exists and raise an error if it doesn't.

Callers 1

validate_config_pathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected