Skip to content

Commit b1010d4

Browse files
authored
Fix(2d_segmentation): Restore the predicted value of seg image to the range of 0~225 before saving it
1 parent 4a40380 commit b1010d4

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

2d_segmentation/torch/unet_evaluation_array.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def main(tempdir):
7272
# compute metric for current iteration
7373
dice_metric(y_pred=val_outputs, y=val_labels)
7474
for val_output in val_outputs:
75+
val_output = (val_output * 255).to(torch.uint8)
7576
saver(val_output)
7677
# aggregate the final mean dice result
7778
print("evaluation metric:", dice_metric.aggregate().item())

2d_segmentation/torch/unet_evaluation_dict.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def main(tempdir):
8787
# compute metric for current iteration
8888
dice_metric(y_pred=val_outputs, y=val_labels)
8989
for val_output in val_outputs:
90+
val_output = (val_output * 255).to(torch.uint8)
9091
saver(val_output)
9192
# aggregate the final mean dice result
9293
print("evaluation metric:", dice_metric.aggregate().item())

0 commit comments

Comments
 (0)