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

Function resize_keepdims

examples/DeepQNetwork/DQN.py:35–40  ·  view source on GitHub ↗
(im, size)

Source from the content-addressed store, hash-verified

33
34
35def resize_keepdims(im, size):
36 # Opencv's resize remove the extra dimension for grayscale images. We add it back.
37 ret = cv2.resize(im, size)
38 if im.ndim == 3 and ret.ndim == 2:
39 ret = ret[:, :, np.newaxis]
40 return ret
41
42
43def get_player(viz=False, train=False):

Callers 1

get_playerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected