mit-han-lab / temporal-shift-module

[ICCV 2019] TSM: Temporal Shift Module for Efficient Video Understanding
https://arxiv.org/abs/1811.08383
MIT License
2.05k stars 418 forks source link

Unable to understand average_duration > 0 and record.num_frames > self.num_segments: #216

Open ZubairKhan001 opened 2 years ago

ZubairKhan001 commented 2 years ago

Hi, i guess using two conditions in the code doesn't make same sense. in ops/dataset if average is >0, it is by default true that record.num_frames > self.num_segments. So whats the point of adding again as a condition. Someone please put some light on it.

mikatsukons commented 1 year ago

It may be a bit late but... The first condition is more specific than the second one (meaning that if the 1st is true then 2nd will be true ALWAYS. However, if 2 is true doesn't mean necessarily than 1 will also be true.) if a < 5: do something. #runs for input < 5 (a<5) elif a < 10: do something else # runs for input less than 10 but greater or equal to 5 (5<=a<10) else: do something different # runs for input greater or equal to 10 (a>=10)