You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix randint error in video tutorial by casting frame count diff to int
In frames_from_video_file, cv2.VideoCapture().get(cv2.CAP_PROP_FRAME_COUNT)
returns a float. This causes random.randint to fail with:
TypeError: 'float' object cannot be interpreted as an integer
Fix: cast (video_length - need_length) to int before passing to randint.
0 commit comments