MCPcopy Create free account
hub / github.com/commaai/research / transform

Function transform

models/utils.py:57–63  ·  view source on GitHub ↗
(image, npx=64, is_crop=True)

Source from the content-addressed store, hash-verified

55 [resize_w, resize_w])
56
57def transform(image, npx=64, is_crop=True):
58 # npx : # of pixels width/height of image
59 if is_crop:
60 cropped_image = center_crop(image, npx)
61 else:
62 cropped_image = image
63 return np.array(cropped_image)/127.5 - 1.
64
65def inverse_transform(images):
66 return (images+1.)/2.

Callers 1

get_imageFunction · 0.85

Calls 1

center_cropFunction · 0.85

Tested by

no test coverage detected