You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
267 B
Pyton

# Copyright (C) 2022 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