MCPcopy Create free account
hub / github.com/PowerHouseMan/ComfyUI-AdvancedLivePortrait / rgb_crop

Function rgb_crop

nodes.py:48–49  ·  view source on GitHub ↗
(rgb, region)

Source from the content-addressed store, hash-verified

46def pil2tensor(image):
47 return torch.from_numpy(np.array(image).astype(np.float32) / 255.0).unsqueeze(0)
48def rgb_crop(rgb, region):
49 return rgb[region[1]:region[3], region[0]:region[2]]
50
51def rgb_crop_batch(rgbs, region):
52 return rgbs[:, region[1]:region[3], region[0]:region[2]]

Callers 2

crop_faceMethod · 0.85
prepare_sourceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected