-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow png mask without double extension #3284
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
Allow png mask without double extension #3284
Conversation
Probably I've missed a step, how should I continue running the tests and so? |
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.
Thank you. LGTM.
Updated from master (workflows failed!) |
Head branch was pushed to by a user without write access
@ahojnnes I've removed const qualifier from mask_path to enable its modification during the fallback check for mask files without a .png extension. That was the reason why the workflows were not compiling. |
I'm seeing a code format check failure specifically on the COLMAP (Ubuntu) / ubuntu-22.04 Release (pull_request) CI job, while other checks are passing. I cannot imagine why this specific job is failing on the format check. Any insights? |
The code format check is only implemented in this one CI job. |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
That's weird, I've run Clang locally and it triggers no conflicts. |
Did you run |
Done, fingers crossed. |
By default, COLMAP searches for mask files by appending ".png" to the image filename. However, this can lead to unexpected behavior when the original image already has a ".png" extension. For example, an image named "image0001.png" would require a mask named "image0001.png.png", which is unintuitive and may cause compatibility issues with other tools that rely on masks, potentially requiring duplicate files.
This patch retains the current behavior as the primary lookup method but introduces a fallback: if the image already has a .png extension and the initial mask file is not found, it also checks for a mask with the exact same name. Since COLMAP allows specifying separate directories for images and masks, having identical filenames is not problematic.
Thank you for considering this patch.