MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / infer_panel_attrs

Function infer_panel_attrs

PosterAgent/tree_split_layout.py:493–504  ·  view source on GitHub ↗
(panel_model, tp, gp)

Source from the content-addressed store, hash-verified

491
492
493def infer_panel_attrs(panel_model, tp, gp):
494 # sp = w_s dot [tp, gp, 1]
495 # rp = w_r dot [tp, gp, 1]
496 vec = np.array([tp, gp, 1.0])
497 w_s = panel_model["w_s"]
498 w_r = panel_model["w_r"]
499 sp = np.dot(w_s, vec)
500 rp = np.dot(w_r, vec)
501 # clamp
502 sp = max(sp, 0.01)
503 rp = max(rp, 0.05)
504 return sp, rp
505
506
507def panel_layout_generation(panels, x, y, w, h):

Callers 1

main_inferenceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected