MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / inv_normalize_batch

Function inv_normalize_batch

PATH/helper/vis_helper.py:9–17  ·  view source on GitHub ↗
(image, mean_arr, stddev_arr)

Source from the content-addressed store, hash-verified

7
8
9def inv_normalize_batch(image, mean_arr, stddev_arr):
10 # normalize image color channels
11 inv_normed_image = image.clone()
12 for c in range(3):
13 if len(image.size()) == 4:
14 inv_normed_image[:, c, :, :] = (image[:, c, :, :] * stddev_arr[c] + mean_arr[c])
15 else:
16 inv_normed_image[c, :, :] = (image[c, :, :] * stddev_arr[c] + mean_arr[c])
17 return inv_normed_image
18
19
20def get_vis_data(input, range_low=-1, range_high=1, vis_height=-1, vis_width=-1, to_rgb=True):

Callers

nothing calls this directly

Calls 2

cloneMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected