MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / get_h_w

Function get_h_w

datasets/aspect.py:5–12  ·  view source on GitHub ↗
(a, ts, eps=1e-4)

Source from the content-addressed store, hash-verified

3
4# computation
5def get_h_w(a, ts, eps=1e-4):
6 h = (ts * a)**0.5
7 h = h + eps
8 h = math.ceil(h) if math.ceil(h) % 2 == 0 else math.floor(h)
9 w = h / a
10 w = w + eps
11 w = math.ceil(w) if math.ceil(w) % 2 == 0 else math.floor(w)
12 return h, w
13
14
15def get_aspect_ratios_dict(ars, ts=360 * 640):

Callers 1

get_aspect_ratios_dictFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected