Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore same_on_sequence when no time dimension #200

Merged
merged 2 commits into from
Jul 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions alodataset/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,17 @@ def __call__(self, frames: Union[Mapping[str, Frame], List[Frame], Frame], **kwa
)
n_set[key].append(result.temporal())
n_set[key] = torch.cat(n_set[key], dim=0)
# Same on all frames and same on sequence
elif same_on_frames and same_on_sequence:
# Same on all frames
elif same_on_frames:
frame_params = self.sample_params() if frame_params is None else frame_params
# print('same_on_frames.....', frame_params)
self.set_params(*frame_params)
n_set[key] = self.apply(frames[key], **kwargs)

elif not same_on_frames and same_on_sequence:
else:
# print("not same on frames")
self.set_params(*self.sample_params())
n_set[key] = self.apply(frames[key], **kwargs)
else:
raise Exception("Not handle error")

return n_set
else:
Expand Down Expand Up @@ -664,7 +662,7 @@ def sample_params(self):
def apply(self, frame: Frame):
assert frame.normalization == "01", "frame should be normalized between 0 and 1 before color modification"

frame = frame ** self.gamma
frame = frame**self.gamma
frame = frame * self.brightness
# change color by applying different coefficients to R, G, and B channels
C = frame.shape[frame.names.index("C")]
Expand Down