MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / draw_mask

Function draw_mask

tools/preprocess/human_visualization.py:989–996  ·  view source on GitHub ↗
(img, mask, background=0, return_rgba=False)

Source from the content-addressed store, hash-verified

987
988
989def draw_mask(img, mask, background=0, return_rgba=False):
990 img = load_image(img)
991 h, w, _ = img.shape
992 if type(background) == int: # noqa
993 background = np.ones((h, w, 3)).astype(np.uint8) * 255 * background
994 backgournd = cv2.resize(background, (w, h))
995 img_rgba = np.concatenate([img, mask], -1)
996 return alphaMerge(img_rgba, background, 0, 0, return_rgba=True)
997
998
999def draw_pcd(pcd_list, save_path=None):

Callers

nothing calls this directly

Calls 2

load_imageFunction · 0.70
resizeMethod · 0.45

Tested by

no test coverage detected