Skip to content

Commit f1e77f3

Browse files
author
Evgeny Tsykunov
authored
Fix semantic segmentation soft prediction dtype (#2321)
1 parent f94872e commit f1e77f3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ def infer(
219219
current_label_soft_prediction = soft_prediction[:, :, label_index]
220220
if process_soft_prediction:
221221
current_label_soft_prediction = get_activation_map(current_label_soft_prediction)
222+
else:
223+
current_label_soft_prediction = (current_label_soft_prediction * 255).astype(np.uint8)
222224
result_media = ResultMediaEntity(
223225
name=label.name,
224226
type="soft_prediction",

otx/algorithms/segmentation/task.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ def _add_predictions_to_dataset(self, prediction_results, dataset, dump_soft_pre
295295
current_label_soft_prediction = soft_prediction[:, :, label_index]
296296
if process_soft_prediction:
297297
current_label_soft_prediction = get_activation_map(current_label_soft_prediction)
298+
else:
299+
current_label_soft_prediction = (current_label_soft_prediction * 255).astype(np.uint8)
298300
result_media = ResultMediaEntity(
299301
name=label.name,
300302
type="soft_prediction",

0 commit comments

Comments
 (0)