Skip to content

Commit

Permalink
🐞 Bugfix: Set reverse_input_channels to True in OpenVINO models (#2848)
Browse files Browse the repository at this point in the history
* Set reverse_input_channels to True
  • Loading branch information
ashwinvaidya17 authored Jan 29, 2024
1 parent 87df806 commit af77ed0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/otx/algorithms/anomaly/tasks/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def _add_metadata_to_ir(self, model_file: str, export_type: ExportType) -> None:
if "min" in metadata and "max" in metadata:
extra_model_data[("model_info", "normalization_scale")] = metadata["max"] - metadata["min"]

extra_model_data[("model_info", "reverse_input_channels")] = False
extra_model_data[("model_info", "reverse_input_channels")] = True # convert BGR to RGB
extra_model_data[("model_info", "model_type")] = "AnomalyDetection"

labels = []
Expand Down
2 changes: 1 addition & 1 deletion src/otx/algorithms/anomaly/tasks/openvino.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def _metadata_in_ir_format(self) -> Dict[Tuple[str, str], Union[str, int, float,
if "min" in metadata and "max" in metadata:
extra_model_data[("model_info", "normalization_scale")] = metadata["max"] - metadata["min"]

extra_model_data[("model_info", "reverse_input_channels")] = False
extra_model_data[("model_info", "reverse_input_channels")] = True # convert BGR to RGB
extra_model_data[("model_info", "model_type")] = "AnomalyDetection"
extra_model_data[("model_info", "labels")] = "Normal Anomaly"
return extra_model_data
Expand Down

0 comments on commit af77ed0

Please sign in to comment.