cvat/tests/python/cli/conf_threshold_function.py

22 lines
464 B
Python
Raw Normal View History

2025-09-16 01:19:40 +00:00
# Copyright (C) CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
import cvat_sdk.auto_annotation as cvataa
import cvat_sdk.models as models
import PIL.Image
spec = cvataa.DetectionFunctionSpec(
labels=[
cvataa.label_spec("car", 0),
],
)
def detect(
context: cvataa.DetectionFunctionContext, image: PIL.Image.Image
) -> list[models.LabeledShapeRequest]:
return [
cvataa.rectangle(0, [context.conf_threshold, 1, 1, 1]),
]