Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class BertEmbeddingsAdapter(ReidAdapter):

@classmethod
def parameters(cls):
parameters = super(ReidAdapter, cls).parameters()
parameters = super().parameters()
parameters.update({
'target_out': StringField(optional=True, description='Target output layer name')
})
Expand All @@ -123,5 +123,7 @@ def configure(self):
self.joining_method = 'sum'
self.target_out = self.get_value_from_config('target_out')
self.keep_shape = True
self.mean_pooling = False # use 'sentence_similarity_pooling' postprocessor for proper mean pooling with attention to the input_mask
self.grn_workaround = False
# use 'sentence_similarity_pooling' postprocessor for proper mean pooling
# with attention to the input_mask
self.mean_pooling = False
self.grn_workaround = False
3 changes: 2 additions & 1 deletion tools/accuracy_checker/accuracy_checker/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ def ibl_subset(pairs_set, subsample_set, ids):

return list(subsample_set)

def store_first_annotation(self, annotation, identifier, dump_infer_data_path):
@staticmethod
def store_first_annotation(annotation, identifier, dump_infer_data_path):
plain_annotation = {
'class_name': annotation.__class__.__name__,
**{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ def __init__(self, dataset_config, launcher, orig_config,
preprocessor=None, postprocessor=None):
self.dataset_config = dataset_config
self.dataset = None
self.input_feeder = None
self.adapter = None
self.preprocessing_executor = None
self.preprocessor = preprocessor
self.postprocessor = postprocessor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"""
from pathlib import Path
from collections import OrderedDict
import numpy as np
import pickle # nosec B403 # disable import-pickle check
import numpy as np
from ...config import ConfigError
from ...utils import get_path, parse_partial_shape, contains_any
from ...logging import print_info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ def completion_callback(status_code, request_id):
if progress_reporter:
progress_reporter.finish()

if stored_predictions:
print_info("prediction objects are save to {}".format(stored_predictions))
self.stored_prediction_info(stored_predictions)

def process_dataset_async_infer_queue(
self, dataset_iterator, metric_config, progress_reporter, stored_predictions, **kwargs):
Expand Down Expand Up @@ -386,8 +385,7 @@ def completion_callback(request, user_data):
if progress_reporter:
progress_reporter.finish()

if stored_predictions:
print_info("prediction objects are save to {}".format(stored_predictions))
self.stored_prediction_info(stored_predictions)

def process_dataset_sync(self, stored_predictions, progress_reporter, *args, **kwargs):
if self.dataset is None:
Expand Down Expand Up @@ -434,8 +432,7 @@ def process_dataset_sync(self, stored_predictions, progress_reporter, *args, **k
if progress_reporter:
progress_reporter.finish()

if stored_predictions:
print_info("prediction objects are save to {}".format(stored_predictions))
self.stored_prediction_info(stored_predictions)
return self._annotations, self._predictions

def _process_batch_results(
Expand Down Expand Up @@ -633,9 +630,14 @@ def prepare_prediction_to_store(self, batch_predictions, batch_identifiers, batc
prediction_to_store = StoredPredictionBatch(batch_predictions, batch_identifiers, batch_meta)
self.store_predictions(stored_predictions, prediction_to_store)

@staticmethod
def stored_prediction_info(stored_predictions):
if stored_predictions:
print_info("prediction objects are save to {}".format(stored_predictions))

@property
def metrics_results(self):
if not self.metrics_results:
if not self._metrics_results:
self.compute_metrics(print_results=False)
computed_metrics = copy.deepcopy(self._metrics_results)
return computed_metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import multiprocessing
from pathlib import Path
import re
import numpy as np
import pickle # nosec B403 # disable import-pickle check
import numpy as np
from openvino import Core, AsyncInferQueue, get_version, PartialShape, Type, Dimension
from openvino.preprocess import PrePostProcessor
from .dlsdk_launcher_config import (
Expand Down Expand Up @@ -1051,4 +1051,3 @@ def _dump_first_inference(self, input_data, output_data):
with open(self._dump_first_infer_data, 'wb') as file:
pickle.dump(dump_inf_data, file)
self._dump_first_infer_data = None

Loading