Skip to content

Commit

Permalink
Fix tensor type conversion in ResizedMetric to ensure proper handling…
Browse files Browse the repository at this point in the history
… of uint8 format
  • Loading branch information
GabrielBG0 committed Nov 12, 2024
1 parent a0078dd commit e2257a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion minerva/analysis/metrics/transformed_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,5 @@ def resize(self, x: torch.Tensor) -> torch.Tensor:
elif self.target_w_size is None:
scale = target_h_size / h
target_w_size = int(w * scale)
x = x.to(torch.uint8) if x.type() == "torch.LongTensor" else x
x = x.to(torch.uint8) if x.type() != "torch.uint8" else x
return torch.nn.functional.interpolate(x, size=(target_h_size, target_w_size))

0 comments on commit e2257a7

Please sign in to comment.