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

Sorting Issue of input images #37

Open
alexriedel1 opened this issue Feb 14, 2021 · 1 comment
Open

Sorting Issue of input images #37

alexriedel1 opened this issue Feb 14, 2021 · 1 comment

Comments

@alexriedel1
Copy link

alexriedel1 commented Feb 14, 2021

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']
@mrdavoodi
Copy link

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']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants