MCPcopy
hub / github.com/hustvl/Vim / uncompressed_rle

Function uncompressed_rle

det/tests/data/test_coco.py:29–42  ·  view source on GitHub ↗
(mask)

Source from the content-addressed store, hash-verified

27
28
29def uncompressed_rle(mask):
30 l = mask.flatten(order="F").tolist()
31 counts = []
32 p = False
33 cnt = 0
34 for i in l:
35 if i == p:
36 cnt += 1
37 else:
38 counts.append(cnt)
39 p = i
40 cnt = 1
41 counts.append(cnt)
42 return {"counts": counts, "size": [mask.shape[0], mask.shape[1]]}
43
44
45def make_dataset_dicts(mask, compressed: bool = True):

Callers 2

make_dataset_dictsFunction · 0.85
test_uncompressed_RLEMethod · 0.85

Calls 1

flattenMethod · 0.45

Tested by

no test coverage detected