pytorch-video-recognition
pytorch-video-recognition copied to clipboard
The order of frame sequences in Videodataset is wrong.
frames = sorted([os.path.join(file_dir, img) for img in os.listdir(file_dir)])
this operation will get something like
0001
00010
00011
00012
...
00019
0002
00020
00021
...
the correct code should be
frames = sorted([os.path.join(file_dir, img) for img in os.listdir(file_dir)],key=lambda x:int(x.split('/')[-1][:-4]))
0001
0002
0003
0004
...