-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Name-mangling mismatch between submodels #1074
Comments
I've found that the export_visualsfm stage in OpenSfM creates semi-broken nvm files that cannot be opened by mve if filenames contain spaces, further complicating the issue. Notably, this likely also breaks mvstex in the same way as mve. |
Right, NVM files cannot contain spaces; for that reason I'm hesitant to handle it in ODM as well. You would also need to patch mvs-texturing. Perhaps ODM should output a warning and quit. (Or implement a flag to rename files that have spaces automatically). Note the latter can get tricky to implement correctly as GCPs then could be broken. There's also the possibility of collisions ("A A.JPG" and "AA.JPG" in the same folder would be in conflict in you simply remove the space, or if you use a replacement char it's whatever the separator is, eg. "A~A.JPG" and "A A.JPG"). |
I use ReNamer to prevent image collisions on Windows. My basic template is EXIF Date & Camera Model: Something similar could be used with exiv2 to generate a more space/character friendly image (re)naming schema. EXIF date and Make, maybe? |
From a purely practical 'I want all inputs to work'-point of view, it seems the simplest place to implement a renaming strategy is OpenSfM, since it produces the broken NVM files. Otherwise we'll still have OpenSfM users finding out about this the hard way in the future. To that end, I proposed mapillary/OpenSfM#556 which would maintain existing filenames unless they cause issues, in which case spaces will be removed and the name will be suffixed with a hash of the original filename. |
Mm, that could work! Let's see what the OpenSfM folks say. |
@linusmartensson could you open a PR also for our fork at https://github.com/OpenDroneMap/OpenSfM targeting the |
Since the PR is in on our fork and OpenSfM doesn't want it, should we perhaps add in an explicit warning or on our end that spaces in filenames are bad, then close this? |
I think we should handle filenames with spaces, and I think our PR does it; the We try to contribute as much as we can to OpenSfM, but there are features that sometimes are too specific to ODM (this wouldn't be the only one, multi-camera support is another example). |
This should be fixed as of Thanks! |
How did you install OpenDroneMap? (Docker, natively, ...)?
Docker
What's your browser and operating system? (Copy/paste the output of https://www.whatismybrowser.com/)
Chrome 79 on Linux
What is the problem?
When running a submodel using --sm-cluster where the filenames contain spaces, the names are transformed incorrectly during transfer, causing file name mismatches and subsequent submodel processing failures.
Here are the corresponding filenames from the main dataset:
Here are the corresponding filenames in the submodel directory on my master node:
And finally, here are the filenames from within the docker container running the submodel:
(The filename list has been shortened for brevity)
Note the filename change after transfer into the container.
This name change results in an error at the feature matching stage in the submodel:
What should be the expected behavior? If this is a feature request, please describe in detail the changes you think should be made to the code, citing files and lines where changes should be made, if possible.
I considered this while looking around the codebase to find the error. In short, the name-mangling should most likely not be going on at all. You don't want mangled names in features, matches and the like that will no longer match the filenames in /images once all files are transferred back to the origin. It does not seem like any other component in ODM has a problem with unprocessed filenames, so the mangling doesn't seem to be useful either.
Currently the submodel image filenames are mangled at some point during the LRE transfer, but the exif data is copied from the original dataset, where the filenames remain unchanged.
There's some sanitization going on in NodeODM that looks similar to what's going on with the spaces in my filenames, so it might be that, but I can't verify that this is 100% the issue, so I thought it better to leave this issue in the main ODM project: https://github.com/OpenDroneMap/NodeODM/blob/60615c6f91717604e8fb15e8e6076a3b92a58f22/libs/taskNew.js#L84
How can we reproduce this? (What steps did you do to trigger the problem? What parameters are you using for processing? If possible please include a copy of your dataset uploaded on Google Drive or Dropbox. Be detailed)
I would expect this to happen in any dataset where the filenames contain spaces or other special characters that is run with the --sm-cluster option enabled.
A basic test on any dataset of sufficient size would be:
The text was updated successfully, but these errors were encountered: