10 lines
262 B
Python
10 lines
262 B
Python
|
|
# Copyright (C) CVAT.ai Corporation
|
||
|
|
#
|
||
|
|
# SPDX-License-Identifier: MIT
|
||
|
|
|
||
|
|
def to_cvat_mask(box: list, mask):
|
||
|
|
xtl, ytl, xbr, ybr = box
|
||
|
|
flattened = mask[ytl:ybr + 1, xtl:xbr + 1].flat[:].tolist()
|
||
|
|
flattened.extend([xtl, ytl, xbr, ybr])
|
||
|
|
return flattened
|