MCPcopy Index your code
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / generatemask

Function generatemask

src/depthmap_generation.py:944–953  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

942
943
944def generatemask(size):
945 # Generates a Guassian mask
946 mask = np.zeros(size, dtype=np.float32)
947 sigma = int(size[0] / 16)
948 k_size = int(2 * np.ceil(2 * int(size[0] / 16)) + 1)
949 mask[int(0.15 * size[0]):size[0] - int(0.15 * size[0]), int(0.15 * size[1]): size[1] - int(0.15 * size[1])] = 1
950 mask = cv2.GaussianBlur(mask, (int(k_size), int(k_size)), sigma)
951 mask = (mask - mask.min()) / (mask.max() - mask.min())
952 mask = mask.astype(np.float32)
953 return mask
954
955
956def rgb2gray(rgb):

Callers 1

estimateboostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected