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

Function check_valid

tools/preprocess/utils.py:65–68  ·  view source on GitHub ↗
(w, h)

Source from the content-addressed store, hash-verified

63 target_ratio = orig_w / orig_h
64
65 def check_valid(w, h):
66 if w <= 0 or h <= 0:
67 return False
68 return w * h <= target_area and w % divisor == 0 and h % divisor == 0
69
70 def get_ratio_diff(w, h):
71 return abs(w / h - target_ratio)

Callers 1

calculate_new_sizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected