MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / print_numpy

Function print_numpy

pix2pix/util/util.py:69–82  ·  view source on GitHub ↗

Print the mean, min, max, median, std, and size of a numpy array Parameters: val (bool) -- if print the values of the numpy array shp (bool) -- if print the shape of the numpy array

(x, val=True, shp=False)

Source from the content-addressed store, hash-verified

67
68
69def print_numpy(x, val=True, shp=False):
70 """Print the mean, min, max, median, std, and size of a numpy array
71
72 Parameters:
73 val (bool) -- if print the values of the numpy array
74 shp (bool) -- if print the shape of the numpy array
75 """
76 x = x.astype(np.float64)
77 if shp:
78 print('shape,', x.shape)
79 if val:
80 x = x.flatten()
81 print('mean = %3.3f, min = %3.3f, max = %3.3f, median = %3.3f, std=%3.3f' % (
82 np.mean(x), np.min(x), np.max(x), np.median(x), np.std(x)))
83
84
85def mkdirs(paths):

Callers

nothing calls this directly

Calls 1

flattenMethod · 0.80

Tested by

no test coverage detected