MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / get_gaussian_map

Function get_gaussian_map

examples/CaffeModels/load-cpm.py:36–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35@memoized
36def get_gaussian_map():
37 gaussian_map = np.zeros((368, 368), dtype='float32')
38 for x_p in range(368):
39 for y_p in range(368):
40 dist_sq = (x_p - 368 / 2) * (x_p - 368 / 2) + \
41 (y_p - 368 / 2) * (y_p - 368 / 2)
42 exponent = dist_sq / 2.0 / (21**2)
43 gaussian_map[y_p, x_p] = np.exp(-exponent)
44 return gaussian_map.reshape((1, 368, 368, 1))
45
46
47def CPM(image):

Callers 1

CPMFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected