-
Notifications
You must be signed in to change notification settings - Fork 861
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
Mmdet Fix Image Identifier #2492
Mmdet Fix Image Identifier #2492
Conversation
Job PR-2492-7f9f3c2 is done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Please add a docstring before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
start_idx = path.rfind("/") + 1 | ||
end_idx = path.rindex(".") | ||
return int(path[start_idx:end_idx]) | ||
return path[start_idx:end_idx] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work on Windows since it's using \
as a path separators. I suggest just using pathlib
+ replace backslashes to linux format:
from pathlib import Path
def get_image_filename(path: str):
return Path(s.replace('\\', '/')).stem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks!
Job PR-2492-d406ba0 is done. |
Job PR-2492-8646986 is done. |
Previously we used the number in image file name as identifier for image path. But the assumption that image name contains a unique number is not valid. Here we changed to use the image file name (without extension) as the identifier.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.