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

Function get_ratio_diff

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

Source from the content-addressed store, hash-verified

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)
72
73 def round_to_64(value, round_up=False, divisor=64):
74 if round_up:

Callers 1

calculate_new_sizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected