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

Mmdet Fix Image Identifier #2492

Merged

Conversation

FANGAreNotGnu
Copy link
Contributor

@FANGAreNotGnu FANGAreNotGnu commented Nov 28, 2022

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.

@FANGAreNotGnu FANGAreNotGnu changed the title [WIP] Mmdet refactor image num [WIP] Mmdet Fix Image ID Nov 28, 2022
@FANGAreNotGnu FANGAreNotGnu changed the title [WIP] Mmdet Fix Image ID [WIP] Mmdet Fix Image Identifier Nov 28, 2022
@github-actions
Copy link

Job PR-2492-7f9f3c2 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-2492/7f9f3c2/index.html

@FANGAreNotGnu FANGAreNotGnu changed the title [WIP] Mmdet Fix Image Identifier Mmdet Fix Image Identifier Nov 29, 2022
Copy link
Contributor

@bryanyzhu bryanyzhu left a 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.

Copy link
Contributor

@yongxinw yongxinw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gradientsky gradientsky modified the milestones: 0.6 Release, 0.6.1 Release Dec 8, 2022
Comment on lines 530 to 532
start_idx = path.rfind("/") + 1
end_idx = path.rindex(".")
return int(path[start_idx:end_idx])
return path[start_idx:end_idx]
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

Job PR-2492-d406ba0 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-2492/d406ba0/index.html

@github-actions
Copy link

github-actions bot commented Dec 9, 2022

Job PR-2492-8646986 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-2492/8646986/index.html

@FANGAreNotGnu FANGAreNotGnu merged commit 24131cf into autogluon:master Dec 9, 2022
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

Successfully merging this pull request may close these issues.

None yet

5 participants