MCPcopy Create free account
hub / github.com/AiuniAI/Unique3D / erode_alpha

Function erode_alpha

scripts/multiview_inference.py:50–61  ·  view source on GitHub ↗
(img_list)

Source from the content-addressed store, hash-verified

48 return refined_rgbs
49
50def erode_alpha(img_list):
51 out_img_list = []
52 for idx, img in enumerate(img_list):
53 arr = np.array(img)
54 alpha = (arr[:, :, 3] > 127).astype(np.uint8)
55 # erode 1px
56 import cv2
57 alpha = cv2.erode(alpha, np.ones((3, 3), np.uint8), iterations=1)
58 alpha = (alpha * 255).astype(np.uint8)
59 img = Image.fromarray(np.concatenate([arr[:, :, :3], alpha[:, :, None]], axis=-1))
60 out_img_list.append(img)
61 return out_img_list
62import time
63def geo_reconstruct(rgb_pils, normal_pils, front_pil, do_refine=False, predict_normal=True, expansion_weight=0.1, init_type="std"):
64 if front_pil.size[0] <= 512:

Callers 1

geo_reconstructFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected