Skip to content

Commit

Permalink
Merge pull request #270 from Visual-Behavior/thomas/frame-in-resnet-n…
Browse files Browse the repository at this point in the history
…orm-on-init

alobugdays/67-resnet-mean-std-norm-at-instantiation
  • Loading branch information
Data-Iab authored Nov 17, 2022
2 parents 121b3f2 + 8d24390 commit feb811e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions aloscene/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,15 @@ def __new__(
tensor.add_child("scene_flow", labels, align_dim=["B", "T"], mergeable=False)

# 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 feb811e

Please sign in to comment.