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

Function get_mask_boxes

tools/preprocess/utils.py:8–24  ·  view source on GitHub ↗

Args: mask: [h, w] Returns:

(mask)

Source from the content-addressed store, hash-verified

6
7
8def get_mask_boxes(mask):
9 """
10
11 Args:
12 mask: [h, w]
13 Returns:
14
15 """
16 y_coords, x_coords = np.nonzero(mask)
17 if x_coords.size == 0:
18 return None
19 x_min = x_coords.min()
20 x_max = x_coords.max()
21 y_min = y_coords.min()
22 y_max = y_coords.max()
23 bbox = np.array([x_min, y_min, x_max, y_max]).astype(np.int32)
24 return bbox
25
26
27def skip_replace_frame_outputs(frame):

Callers 1

get_aug_maskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected