MCPcopy Create free account
hub / github.com/drinkingcoder/NeuralMarker / get_gaussian_weights

Function get_gaussian_weights

core/utils/utils.py:27–33  ·  view source on GitHub ↗
(x, y, x1, x2, y1, y2)

Source from the content-addressed store, hash-verified

25
26def pytorch_foward_interpolate(flow):
27 def get_gaussian_weights(x, y, x1, x2, y1, y2):
28 w11 = torch.exp(-((x - x1)**2 + (y - y1)**2))
29 w12 = torch.exp(-((x - x1)**2 + (y - y2)**2))
30 w21 = torch.exp(-((x - x2)**2 + (y - y1)**2))
31 w22 = torch.exp(-((x - x2)**2 + (y - y2)**2))
32
33 return w11, w12, w21, w22
34
35 def sample_one(img, shiftx, shifty, weight):
36 """

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected