Skip to content

Commit

Permalink
set mean_std to resnet_rgb_mean_std when in resnet norm
Browse files Browse the repository at this point in the history
  • Loading branch information
tflahaul committed Nov 17, 2022
1 parent 7205308 commit 8d24390
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions aloscene/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,13 @@ def __new__(
# Add other tensor property
assert normalization in {"01", "255", "minmax_sym", "resnet"}, f"{normalization} norm is not yet supported"
tensor.add_property("normalization", normalization)
tensor.add_property("_resnet_mean_std", ((0.485, 0.456, 0.406), (0.229, 0.224, 0.225)))
tensor.add_property("mean_std", mean_std)

resnet_rgb_mean_std = ((0.485, 0.456, 0.406), (0.229, 0.224, 0.225))
tensor.add_property("_resnet_mean_std", resnet_rgb_mean_std)
if normalization == "resnet":
tensor.add_property("mean_std", resnet_rgb_mean_std)
else:
tensor.add_property("mean_std", mean_std)

return tensor

Expand Down

0 comments on commit 8d24390

Please sign in to comment.