As a part of open-forest-observatory/automate-metashape-2#46 , we need to undo the Metashape operation that replaces the symlink location (source) with its destination. We want the image labels to indicate the symlink source, especially for compatibility with tools like DVC and Datalad that store the actual file (destination) in a flattened and hashed annex that is not human-readable or human-writeable.
This utility should be idempotent so that if it is run on a dataset where this was already corrected (or that never had this issue to begin with), it does not make any changes.
It should runnable from a script (either as a command line call or function call) in a way that allows running it from the metashape_workflow.py script.
This PR adds the logic for undoing the symlinks. In that case, the intent was to run the script only in situations where this was a known issue. So additional logic will be required to make it idempotent.
As a part of open-forest-observatory/automate-metashape-2#46 , we need to undo the Metashape operation that replaces the symlink location (source) with its destination. We want the image labels to indicate the symlink source, especially for compatibility with tools like DVC and Datalad that store the actual file (destination) in a flattened and hashed annex that is not human-readable or human-writeable.
This utility should be idempotent so that if it is run on a dataset where this was already corrected (or that never had this issue to begin with), it does not make any changes.
It should runnable from a script (either as a command line call or function call) in a way that allows running it from the metashape_workflow.py script.