ChiWeiHsiao / DeepVO-pytorch

PyTorch Implementation of DeepVO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sorting Issue of input images

alexriedel1 opened this issue · comments

Hello,
thanks for your awesome work. However there is a major issue i guess, in your data_helper.py

fpaths.sort()
. When loading image paths and sorting them, considering your single frames are named:

li = ['00000.png', '00001.png', '00002.png','000010.png', '0000100.png']
li.sort()
will give you:
['00000.png', '00001.png', '000010.png', '0000100.png', '00002.png']
which is not the natural order when someone sliced a video to single frames.

I'm using https://pypi.org/project/natsort/ for this issue, giving you

from natsort import natsorted
li_sorted = natsorted(li)
['00000.png', '00001.png', '00002.png', '000010.png', '0000100.png']

Try to examine a list with the full path. I tried it and got right result! it was like this:
['images/00/00001.png', 'images/00/00002.png', 'images/00/00010.png', 'images/00/00020.png', 'images/01/00001.png', 'images/01/00002.png', 'images/01/00010.png', 'images/01/00020.png', 'images/10/00001.png', 'images/10/00002.png', 'images/10/00010.png', 'images/10/00020.png']