Skip to content

Commit 48731fb

Browse files
author
Maxim Zhiltsov
authored
Merge pull request #121 from openvinotoolkit/develop
Release 0.1.6
2 parents e2d2fa0 + 73bb73f commit 48731fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+4154
-716
lines changed

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,51 @@ 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

88

9+
## [Unreleased]
10+
### Added
11+
-
12+
13+
### Changed
14+
-
15+
16+
### Deprecated
17+
-
18+
19+
### Removed
20+
-
21+
22+
### Fixed
23+
-
24+
25+
### Security
26+
-
27+
28+
## 02/26/2021 - Release v0.1.6
29+
### Added
30+
- `Icdar13/15` dataset format (<https://github.com/openvinotoolkit/datumaro/pull/96>)
31+
- Laziness, source caching, tracking of changes and partial updating for `Dataset` (<https://github.com/openvinotoolkit/datumaro/pull/102>)
32+
- `Market-1501` dataset format (<https://github.com/openvinotoolkit/datumaro/pull/108>)
33+
- `LFW` dataset format (<https://github.com/openvinotoolkit/datumaro/pull/110>)
34+
- Support of polygons' and masks' confusion matrices and mismathing classes in `diff` command (<https://github.com/openvinotoolkit/datumaro/pull/117>)
35+
- Add near duplicate image removal plugin (<https://github.com/openvinotoolkit/datumaro/pull/113>)
36+
37+
### Changed
38+
- OpenVINO model launcher is updated for OpenVINO r2021.1 (<https://github.com/openvinotoolkit/datumaro/pull/100>)
39+
40+
### Deprecated
41+
-
42+
43+
### Removed
44+
-
45+
46+
### Fixed
47+
- High memory consumption and low performance of mask import/export, #53 (<https://github.com/openvinotoolkit/datumaro/pull/101>)
48+
- Masks, covered by class 0 (background), should be exported with holes inside (<https://github.com/openvinotoolkit/datumaro/pull/104>)
49+
- `diff` command invocation problem with missing class methods (<https://github.com/openvinotoolkit/datumaro/pull/117>)
50+
51+
### Security
52+
-
53+
954
## 01/23/2021 - Release v0.1.5
1055
### Added
1156
- `WiderFace` dataset format (<https://github.com/openvinotoolkit/datumaro/pull/65>, <https://github.com/openvinotoolkit/datumaro/pull/90>)

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ CVAT annotations ---> Publication, statistics etc.
135135
- [CamVid](http://mi.eng.cam.ac.uk/research/projects/VideoRec/CamVid/)
136136
- [CVAT](https://github.com/opencv/cvat/blob/develop/cvat/apps/documentation/xml_format.md)
137137
- [LabelMe](http://labelme.csail.mit.edu/Release3.0)
138+
- [ICDAR13/15](https://rrc.cvc.uab.es/?ch=2) (`word_recognition`, `text_localization`, `text_segmentation`)
139+
- [Market-1501](https://www.aitribune.com/dataset/2018051063) (`person re-identification`)
140+
- [LFW](http://vis-www.cs.umass.edu/lfw/) (`person re-identification`, `landmarks`)
138141
- Dataset building
139142
- Merging multiple datasets into one
140143
- Dataset filtering by a custom criteria:
@@ -217,8 +220,7 @@ reading, exporting and iteration capabilities, simplifying integration of custom
217220
formats and providing high performance operations:
218221

219222
``` python
220-
from datumaro.components.project import Project # project-related things
221-
import datumaro.components.extractor # annotations and high-level interfaces
223+
from datumaro.components.project import Project
222224

223225
# load a Datumaro project
224226
project = Project.load('directory')
@@ -227,10 +229,10 @@ project = Project.load('directory')
227229
dataset = project.make_dataset()
228230

229231
# keep only annotated images
230-
dataset = dataset.select(lambda item: len(item.annotations) != 0)
232+
dataset.select(lambda item: len(item.annotations) != 0)
231233

232234
# change dataset labels
233-
dataset = dataset.transform(project.env.transforms.get('remap_labels'),
235+
dataset.transform('remap_labels',
234236
{'cat': 'dog', # rename cat to dog
235237
'truck': 'car', # rename truck to car
236238
'person': '', # remove this label

datumaro/cli/commands/merge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
from collections import OrderedDict
1010

1111
from datumaro.components.project import Project
12-
from datumaro.components.operations import (IntersectMerge,
13-
QualityError, MergeError)
12+
from datumaro.components.operations import IntersectMerge
13+
from datumaro.components.errors import QualityError, MergeError
1414

1515
from ..util import at_least, MultilineFormatter, CliException
1616
from ..util.project import generate_next_file_name, load_project

datumaro/cli/contexts/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
import logging as log
77
import os
88
import os.path as osp
9+
import shutil
910

1011
from datumaro.components.project import Environment
12+
from datumaro.util import error_rollback
1113

1214
from ..util import CliException, MultilineFormatter, add_subparser
1315
from ..util.project import load_project, \
@@ -43,6 +45,7 @@ def build_add_parser(parser_ctor=argparse.ArgumentParser):
4345

4446
return parser
4547

48+
@error_rollback('on_error', implicit=True)
4649
def add_command(args):
4750
project = load_project(args.project_dir)
4851

@@ -69,6 +72,7 @@ def add_command(args):
6972
model_dir = osp.join(project.config.project_dir,
7073
project.local_model_dir(args.name))
7174
os.makedirs(model_dir, exist_ok=False)
75+
on_error.do(shutil.rmtree, model_dir, ignore_errors=True)
7276

7377
try:
7478
cli_plugin.copy_model(model_dir, model_args)

datumaro/cli/contexts/project/__init__.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
from datumaro.components.project import \
1919
PROJECT_DEFAULT_CONFIG as DEFAULT_CONFIG
2020
from datumaro.components.project import Environment, Project
21+
from datumaro.util import error_rollback
2122

2223
from ...util import (CliException, MultilineFormatter, add_subparser,
2324
make_file_name)
2425
from ...util.project import generate_next_file_name, load_project
25-
from .diff import DiffVisualizer
26+
from .diff import DatasetDiffVisualizer
2627

2728

2829
def build_create_parser(parser_ctor=argparse.ArgumentParser):
@@ -506,8 +507,8 @@ def build_diff_parser(parser_ctor=argparse.ArgumentParser):
506507
parser.add_argument('-o', '--output-dir', dest='dst_dir', default=None,
507508
help="Directory to save comparison results (default: do not save)")
508509
parser.add_argument('-v', '--visualizer',
509-
default=DiffVisualizer.DEFAULT_FORMAT,
510-
choices=[f.name for f in DiffVisualizer.Format],
510+
default=DatasetDiffVisualizer.DEFAULT_FORMAT.name,
511+
choices=[f.name for f in DatasetDiffVisualizer.OutputFormat],
511512
help="Output format (default: %(default)s)")
512513
parser.add_argument('--iou-thresh', default=0.5, type=float,
513514
help="IoU match threshold for detections (default: %(default)s)")
@@ -521,6 +522,7 @@ def build_diff_parser(parser_ctor=argparse.ArgumentParser):
521522

522523
return parser
523524

525+
@error_rollback('on_error', implicit=True)
524526
def diff_command(args):
525527
first_project = load_project(args.project_dir)
526528
second_project = load_project(args.other_project_dir)
@@ -540,17 +542,14 @@ def diff_command(args):
540542
dst_dir = osp.abspath(dst_dir)
541543
log.info("Saving diff to '%s'" % dst_dir)
542544

543-
dst_dir_existed = osp.exists(dst_dir)
544-
try:
545-
visualizer = DiffVisualizer(save_dir=dst_dir, comparator=comparator,
546-
output_format=args.visualizer)
547-
visualizer.save_dataset_diff(
545+
if not osp.exists(dst_dir):
546+
on_error.do(shutil.rmtree, dst_dir, ignore_errors=True)
547+
548+
with DatasetDiffVisualizer(save_dir=dst_dir, comparator=comparator,
549+
output_format=args.visualizer) as visualizer:
550+
visualizer.save(
548551
first_project.make_dataset(),
549552
second_project.make_dataset())
550-
except BaseException:
551-
if not dst_dir_existed and osp.isdir(dst_dir):
552-
shutil.rmtree(dst_dir, ignore_errors=True)
553-
raise
554553

555554
return 0
556555

0 commit comments

Comments
 (0)