Update sorting logic in scene/dataset_readers.py for readColmapSceneInfo #735
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, I found an issue in
scene/dataset_readers.py
. Specifically, there was a problem with the sorting logic when images were named using numbers, leading to incorrect ordering. The root cause was the original sorting based on theimage_name
attribute, which resulted in unexpected sorting due to the way Python sorts characters. For example, images named as 1.png, 11.png, 2.png, and 22.png were being sorted as 1.png, 11.png, 2.png, and 22.png, respectively.This PR fixes the issue where images were not sorted correctly when their names contained numbers. The previous sorting based on
image_name
resulted in incorrect order due to the way characters are sorted in Python. By changing the sorting key touid
, the images are now sorted accurately and consistently.