Skip to content

Commit 75e2319

Browse files
authored
Update changelog and bump version (#298)
* Added all segmentation to poly metrics * Clean up init * Add segmentation configs * Add SegmentatioToPolyAveragePrecision and update changelog and bump version
1 parent 4d26de6 commit 75e2319

File tree

3 files changed

+64
-1
lines changed

3 files changed

+64
-1
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to the [Nucleus Python Client](https://github.com/scaleapi/n
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.11.0](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.11.0) - 2022-05-13
9+
10+
### Added
11+
- Segmentation prediction masks can now be evaluated against polygon annotation with new Validate functions
12+
- New function SegmentationToPolyIOU, configurable through client.validate.eval_functions.segmentation_to_poly_iou
13+
- New function SegmentationToPolyRecall, configurable through client.validate.eval_functions.segmentation_to_poly_recall
14+
- New function SegmentationToPolyPrecision, configurable through client.validate.eval_functions.segmentation_to_poly_precision
15+
- New function SegmentationToPolyMAP, configurable through client.validate.eval_functions.segmentation_to_poly_map
16+
- New function SegmentationToPolyAveragePrecision, configurable through client.validate.eval_functions.segmentation_to_poly_ap
17+
818
## [0.10.8](https://github.com/scaleapi/nucleus-python-client/releases/tag/v0.10.8) - 2022-05-10
919

1020
### Fixed

nucleus/validate/eval_functions/available_eval_functions.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,55 @@ def expected_name(cls) -> str:
522522
return "segmentation_to_poly_precision"
523523

524524

525+
class SegmentationToPolyAveragePrecisionConfig(EvalFunctionConfig):
526+
def __call__(
527+
self,
528+
label: str = "label",
529+
iou_threshold: float = 0.5,
530+
annotation_filters: Optional[
531+
Union[ListOfOrAndFilters, ListOfAndFilters]
532+
] = None,
533+
prediction_filters: Optional[
534+
Union[ListOfOrAndFilters, ListOfAndFilters]
535+
] = None,
536+
**kwargs,
537+
):
538+
"""Initializes SegmentationToPolyAveragePrecision object.
539+
540+
Args:
541+
iou_threshold: IOU threshold to consider detection as valid. Must be in [0, 1]. Default 0.5
542+
annotation_filters: Filter predicates. Allowed formats are:
543+
ListOfAndFilters where each Filter forms a chain of AND predicates.
544+
or
545+
ListOfOrAndFilters where Filters are expressed in disjunctive normal form (DNF), like
546+
[[MetadataFilter("short_haired", "==", True), FieldFilter("label", "in", ["cat", "dog"]), ...].
547+
DNF allows arbitrary boolean logical combinations of single field predicates. The innermost structures
548+
each describe a single column predicate. The list of inner predicates is interpreted as a conjunction
549+
(AND), forming a more selective `and` multiple field predicate.
550+
Finally, the most outer list combines these filters as a disjunction (OR).
551+
prediction_filters: Filter predicates. Allowed formats are:
552+
ListOfAndFilters where each Filter forms a chain of AND predicates.
553+
or
554+
ListOfOrAndFilters where Filters are expressed in disjunctive normal form (DNF), like
555+
[[MetadataFilter("short_haired", "==", True), FieldFilter("label", "in", ["cat", "dog"]), ...].
556+
DNF allows arbitrary boolean logical combinations of single field predicates. The innermost structures
557+
each describe a single column predicate. The list of inner predicates is interpreted as a conjunction
558+
(AND), forming a more selective `and` multiple field predicate.
559+
Finally, the most outer list combines these filters as a disjunction (OR).
560+
"""
561+
return super().__call__(
562+
label=label,
563+
iou_threshold=iou_threshold,
564+
annotation_filters=annotation_filters,
565+
prediction_filters=prediction_filters,
566+
**kwargs,
567+
)
568+
569+
@classmethod
570+
def expected_name(cls) -> str:
571+
return "segmentation_to_poly_ap"
572+
573+
525574
class BoundingBoxIOUConfig(EvalFunctionConfig):
526575
def __call__(
527576
self,
@@ -1147,6 +1196,7 @@ def expected_name(cls) -> str:
11471196
SegmentationToPolyIOUConfig,
11481197
SegmentationToPolyMAPConfig,
11491198
SegmentationToPolyPrecisionConfig,
1199+
SegmentationToPolyAveragePrecisionConfig,
11501200
]
11511201

11521202

@@ -1226,6 +1276,9 @@ def __init__(self, available_functions: List[EvalFunctionEntry]):
12261276
self.segmentation_to_poly_map: SegmentationToPolyMAPConfig = self._assign_eval_function_if_defined(
12271277
SegmentationToPolyMAPConfig # type: ignore
12281278
)
1279+
self.segmentation_to_poly_ap: SegmentationToPolyAveragePrecisionConfig = self._assign_eval_function_if_defined(
1280+
SegmentationToPolyAveragePrecisionConfig # type: ignore
1281+
)
12291282

12301283
# Add public entries that have not been implemented as an attribute on this class
12311284
for func_entry in self._public_func_entries.values():

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude = '''
2121

2222
[tool.poetry]
2323
name = "scale-nucleus"
24-
version = "0.10.8"
24+
version = "0.11.0"
2525
description = "The official Python client library for Nucleus, the Data Platform for AI"
2626
license = "MIT"
2727
authors = ["Scale AI Nucleus Team <nucleusapi@scaleapi.com>"]

0 commit comments

Comments
 (0)