Skip to content

Commit

Permalink
fix benchmarker tests
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Davidyuk <igor.davidyuk@intel.com>
  • Loading branch information
igor-davidyuk committed Jul 2, 2024
1 parent 96dd4d3 commit bba386f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions geti_sdk/benchmarking/benchmarker.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ def compare_predictions(
with open(throughput_benchmark_results, "r") as results_file:
throughput_benchmark_results = list(csv.DictReader(results_file))

visusalizer = Visualizer()
visualizer = Visualizer()

# Performe inferece
with logging_redirect_tqdm(tqdm_class=tqdm):
Expand Down Expand Up @@ -892,7 +892,7 @@ def compare_predictions(
f"failed. Inference failed with error: `{e}`"
)
if success:
image_with_prediction = visusalizer.draw(image, prediction)
image_with_prediction = visualizer.draw(image, prediction)
image_with_prediction = cv2.cvtColor(
image_with_prediction, cv2.COLOR_BGR2RGB
)
Expand Down Expand Up @@ -953,7 +953,7 @@ def compare_predictions(
if include_online_prediction_for_active_model:
logging.info("Predicting on the platform using the active model")
online_prediction_result = self._predict_using_active_model(image)
image_with_prediction = visusalizer.draw(
image_with_prediction = visualizer.draw(
image, online_prediction_result["prediction"]
)
image_with_prediction = cv2.cvtColor(
Expand Down
6 changes: 3 additions & 3 deletions tests/pre-merge/unit/benchmarking/test_benchmarker.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ def test_compare_predictions(
_ = mocker.patch(
"geti_sdk.benchmarking.benchmarker.cv2.putText",
)
mock_show_image_with_annotation_scene = mocker.patch(
"geti_sdk.benchmarking.benchmarker.show_image_with_annotation_scene",
mock_visualizer_draw = mocker.patch(
"geti_sdk.benchmarking.benchmarker.Visualizer.draw",
return_value=mock_image,
)
mock_pad_image_and_put_caption = mocker.patch(
Expand Down Expand Up @@ -393,7 +393,7 @@ def test_compare_predictions(
mock_image
)
assert (
mock_show_image_with_annotation_scene.call_count
mock_visualizer_draw.call_count
== mock_pad_image_and_put_caption.call_count
== (
# Calls for deployments + online prediction call
Expand Down

0 comments on commit bba386f

Please sign in to comment.