Skip to content

Commit 6939daf

Browse files
Songki ChoiEvgeny Tsykunov
Songki Choi
and
Evgeny Tsykunov
authored
Merge back bug fixes in release 1.1.2 (#1971)
* Fix exception -> warning for anomaly dump_feature option * Remove `dataset.with_empty_annotations()` to keep original input structure (#1964) * Fix OV batch inference (saliency map generation) (#1965) * Release 1.1.2 RC1 * Fix classification model download logic to resolve zip issue (#1967) * Replace model download logic by pytorchcv to resolve zip issue * Update change log * Fix pre-commit * Configure checkpoint before model * Add pytorchcv to cls/seg requirement * Hot fix for numpy attr for ResultMediaEntity * Release 1.1.2 * Update exportable code demo commit --------- Co-authored-by: Evgeny Tsykunov <evgeny.tsykunov@intel.com>
1 parent cc5ae21 commit 6939daf

File tree

11 files changed

+19
-9
lines changed

11 files changed

+19
-9
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ All notable changes to this project will be documented in this file.
2222
- OpenVINO(==2022.3) IR inference is not working well on 2-stage models (e.g. Mask-RCNN) exported from torch==1.13.1
2323
(working well up to torch==1.12.1) (<https://github.com/openvinotoolkit/training_extensions/issues/1906>)
2424

25+
## \[v1.1.2\]
26+
27+
### Bug fixes
28+
29+
- Fix exception -> warning for anomaly dump_feature option
30+
- Remove `dataset.with_empty_annotations()` to keep original input structure (<https://github.com/openvinotoolkit/training_extensions/pull/1964>)
31+
- Fix OV batch inference (saliency map generation) (<https://github.com/openvinotoolkit/training_extensions/pull/1965>)
32+
- Replace EfficentNetB0 model download logic by pytorchcv to resolve zip issue (<https://github.com/openvinotoolkit/training_extensions/pull/1967>)
33+
2534
## \[v1.1.1\]
2635

2736
### Bug fixes

otx/algorithms/anomaly/tasks/inference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def export(
266266
Exception: If export_type is not ExportType.OPENVINO
267267
"""
268268
if dump_features:
269-
raise NotImplementedError(
269+
logger.warning(
270270
"Feature dumping is not implemented for the anomaly task."
271271
"The saliency maps and representation vector outputs will not be dumped in the exported model."
272272
)

otx/algorithms/classification/adapters/mmcls/tasks/stage.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def configure(self, model_cfg, model_ckpt, data_cfg, training=True, **kwargs):
3030

3131
# Recipe + model
3232
cfg = self.cfg
33-
self.configure_model(cfg, model_cfg, **kwargs)
3433
self.configure_ckpt(cfg, model_ckpt, kwargs.get("pretrained", None))
34+
self.configure_model(cfg, model_cfg, **kwargs)
3535
self.configure_data(cfg, data_cfg, training)
3636
self.configure_task(cfg, training)
3737
return cfg

otx/algorithms/classification/tasks/inference.py

-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ def infer(
127127
logger.info("called infer()")
128128
stage_module = "ClsInferrer"
129129
self._data_cfg = self._init_test_data_cfg(dataset)
130-
dataset = dataset.with_empty_annotations()
131130

132131
dump_features = True
133132
dump_saliency_map = not inference_parameters.is_evaluation if inference_parameters else True
@@ -169,7 +168,6 @@ def explain(
169168
logger.info("called explain()")
170169
stage_module = "ClsExplainer"
171170
self._data_cfg = self._init_test_data_cfg(dataset)
172-
dataset = dataset.with_empty_annotations()
173171

174172
results = self._run_task(
175173
stage_module,

otx/algorithms/classification/tasks/openvino.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def explain(
273273
dataset_item.append_labels(item_labels)
274274
add_saliency_maps_to_dataset_item(
275275
dataset_item=dataset_item,
276-
saliency_map=np.copy(saliency_map),
276+
saliency_map=saliency_map,
277277
model=self.model,
278278
labels=self.task_environment.get_labels(),
279279
predicted_scored_labels=item_labels,

otx/algorithms/common/adapters/mmcv/models/backbones/efficientnet.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from mmcv.cnn import build_activation_layer
1919
from mmcv.cnn.bricks import ConvModule
2020
from mmcv.runner import load_checkpoint
21+
from pytorchcv.models.model_store import download_model
2122
from torch import nn
2223
from torch.nn import init
2324

@@ -1308,5 +1309,5 @@ def init_weights(self, pretrained=None):
13081309
load_checkpoint(self, pretrained)
13091310
logger.info(f"init weight - {pretrained}")
13101311
elif pretrained is not None:
1311-
load_checkpoint(self, pretrained_urls[self.model_name])
1312+
download_model(net=self, model_name=self.model_name)
13121313
logger.info(f"init weight - {pretrained_urls[self.model_name]}")

otx/algorithms/detection/adapters/openvino/task.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def explain(
465465

466466
add_saliency_maps_to_dataset_item(
467467
dataset_item=dataset_item,
468-
saliency_map=np.copy(saliency_map),
468+
saliency_map=saliency_map,
469469
model=self.model,
470470
labels=labels,
471471
predicted_scored_labels=predicted_scored_labels,

otx/api/entities/result_media.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __init__(
8282
self.annotation_scene = annotation_scene
8383
self.roi = Annotation(Rectangle.generate_full_box(), labels=[]) if roi is None else roi
8484
self.label = label
85-
self.numpy = numpy
85+
self._numpy = np.copy(numpy)
8686

8787
def __repr__(self):
8888
"""Returns a string with all the attributes of the ResultMediaEntity."""
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
openvino==2022.3.0
22
openmodelzoo-modelapi==2022.3.0
3-
otx @ git+https://github.com/openvinotoolkit/training_extensions/@9753acd6fef11fa83240e6ed3a031fb9a3e62b0f#egg=otx
3+
otx @ git+https://github.com/openvinotoolkit/training_extensions/@dd03235da2319815227f1b75bce298ee6e8b0f31#egg=otx
44
numpy>=1.21.0,<=1.23.5 # np.bool was removed in 1.24.0 which was used in openvino runtime

requirements/classification.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ mmcv-full==1.7.0
44
mmcls==0.25.0
55
timm
66
otxdeploy==0.12.1 # FIXME: mmdeploy==? when PyPI packages are available
7+
pytorchcv

requirements/segmentation.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ mmsegmentation==0.30.0
55
scikit-image
66
otxdeploy==0.12.1 # FIXME: mmdeploy==? when PyPI packages are available
77
timm
8+
pytorchcv

0 commit comments

Comments
 (0)