MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / load_image_np

Function load_image_np

tools/tensorflow-quantization/examples/data/data_loader.py:90–97  ·  view source on GitHub ↗
(test_image, model_name: str = "resnet_v1")

Source from the content-addressed store, hash-verified

88
89
90def load_image_np(test_image, model_name: str = "resnet_v1"):
91 # Image is loaded in NHWC format
92 image_np = np.asarray(PIL.Image.open(test_image).convert('RGB'))
93 image = tf.constant(image_np)
94 image = _aspect_preserving_resize(image, _RESIZE_MIN[model_name])
95 image = _central_crop(image, _DEFAULT_IMAGE_SIZE[model_name], _DEFAULT_IMAGE_SIZE[model_name])
96 image = preprocess_model_func(image, model_name)
97 return image
98
99
100def get_filenames(

Callers 1

infer_engine.pyFile · 0.90

Calls 5

_central_cropFunction · 0.85
preprocess_model_funcFunction · 0.85
constantMethod · 0.80
convertMethod · 0.45

Tested by

no test coverage detected