Skip to content

Commit

Permalink
Hotfix to release 1.3.2 (#1050)
Browse files Browse the repository at this point in the history
- Install dvc version to 2.x #1048 
- Replace np.append() in Validator (ticket no. 113373)
- Let CocoBase continue even if an InvalidAnnotationError is raised
  • Loading branch information
vinnamkim authored Jun 16, 2023
2 parents 228fd10 + fdc7ecc commit f45e8aa
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 8 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## \[Unreleased\]

## 26/05/2023 - Release 1.3.2
### Enhancements
- Let CocoBase continue even if an InvalidAnnotationError is raised
(<https://github.com/openvinotoolkit/datumaro/pull/1050>)

### Bug fixes
- Install dvc version to 2.x
(<https://github.com/openvinotoolkit/datumaro/pull/1048>)
- Replace np.append() in Validator
(<https://github.com/openvinotoolkit/datumaro/pull/1050>)

## 26/05/2023 - Release 1.3.1
### Bug fixes
- Fix Cityscapes format mis-detection
Expand Down
6 changes: 4 additions & 2 deletions datumaro/plugins/data_formats/coco/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ def _load_items(self, json_data):
try:
img_id = self._parse_field(ann, "image_id", int)
if img_id not in img_infos:
raise InvalidAnnotationError(f"Unknown image id '{img_id}'")
log.warn(f"Unknown image id '{img_id}'")
continue

self._load_annotations(
ann, img_infos[img_id], parsed_annotations=items[img_id].annotations
Expand All @@ -284,7 +285,8 @@ def _load_items(self, json_data):
try:
img_id = self._parse_field(ann, "image_id", int)
if img_id not in img_infos:
raise InvalidAnnotationError(f"Unknown image id '{img_id}'")
log.warn(f"Unknown image id '{img_id}'")
continue

self._load_panoptic_ann(ann, items[img_id].annotations)
except Exception as e:
Expand Down
5 changes: 2 additions & 3 deletions datumaro/plugins/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class _TaskValidator(Validator, CliPlugin):
"bins": [],
"counts": [],
},
"distribution": np.array([]),
"distribution": [],
}

"""
Expand Down Expand Up @@ -790,8 +790,7 @@ def generate_reports(self, stats):
def _update_prop_distributions(self, curr_stats, target_stats):
for prop, val in curr_stats.items():
prop_stats = target_stats[prop]
prop_dist = prop_stats["distribution"]
prop_stats["distribution"] = np.append(prop_dist, val)
prop_stats["distribution"].append(val)

def _compute_prop_dist(self, label_categories, stats, update_stats_by_label):
dist_by_label = stats["point_distribution_in_label"]
Expand Down
2 changes: 1 addition & 1 deletion datumaro/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3.1"
__version__ = "1.3.2"
12 changes: 12 additions & 0 deletions docs/source/docs/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ Release Notes
.. toctree::
:maxdepth: 1

v1.3.2 (2023.06)
----------------

Enhancements
^^^^^^^^^^^^
- Let CocoBase continue even if an InvalidAnnotationError is raised

Bug fixes
^^^^^^^^^
- Install dvc version to 2.x
- Replace np.append() in Validator

v1.3.1 (2023.05)
----------------

Expand Down
2 changes: 1 addition & 1 deletion requirements-default.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dvc>=2.7.0
dvc>=2.7.0,<3.0.0
fsspec <= 2022.11.0; python_version < '3.8' # https://github.com/openvinotoolkit/datumaro/actions/runs/4003215621/jobs/6871114851#step:5:1647
GitPython>=3.1.18,!=3.1.25 # https://github.com/openvinotoolkit/datumaro/issues/612
openvino-telemetry>=2022.1.0
6 changes: 5 additions & 1 deletion tests/unit/test_coco_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from functools import partial
from io import StringIO
from itertools import product
from unittest import TestCase
from unittest import TestCase, skip

import numpy as np

Expand Down Expand Up @@ -1267,6 +1267,10 @@ def test_can_report_invalid_polygon_less_than_3_points(self):
self.assertIsInstance(capture.exception.__cause__, InvalidAnnotationError)
self.assertIn("at least 3 (x, y) pairs", str(capture.exception.__cause__))

@skip(
"CocoBase is changed to skip loading annotation "
"if there is no image id reference rather than raising an error."
)
@mark_requirement(Requirements.DATUM_ERROR_REPORTING)
def test_can_report_invalid_image_id(self):
with TestDir() as test_dir:
Expand Down

0 comments on commit f45e8aa

Please sign in to comment.