open-forest-observatory / automate-metashape

Easy, reproducible Metashape photogrammetry workflows
Other
76 stars 27 forks source link

Convert metashape workflow functions module into a python class #24

Open youngdjn opened 4 years ago

youngdjn commented 4 years ago

This would allow the config file, log file, and metashape doc to exist as attributes of the class/object rather than needing to pass to each function.

PeterBetlem commented 4 years ago

Hi, just wondering - any progress on this? I have been using your (great) scripts for a while now to standardise the local procedures, but we have a bunch of networked PCs running rather than a proper cluster. Having the class/object with attributes would make a much more streamlined approach to setting up the network node using the list feature documented in the Metashape API document.

EDIT: Has been partially added to the fork implementing networking scripts and ArUcO marker detection at https://github.com/PeterBetlem/image_processing/blob/master/python/metashape_workflow_class.py - let me know whether any of this falls within the scope of the work, and I'll put in a pull request for further discussion.

youngdjn commented 4 years ago

Glad to hear the scripts are useful for you! This is still on the to-do list, but unfortunately I'm not able to make it a priority in the near term. Any PRs toward this goal would be very welcome! Otherwise I hope to get to it around Nov/Dec.

youngdjn commented 4 years ago

Just saw your edit regarding the partial implementation -- awesome, I will check out the fork soon and get back to you.

PeterBetlem commented 4 years ago

Alright, let me know - I separated the marker detection and masking features into a separate repo, and also updated the current networking class to include the standalone features as well. Sadly running into some issues with the BuildUV, but will give this another shot tomorrow.

PeterBetlem commented 4 years ago

The link above now links to a fully rewritten class that

I'll be out in the field for a couple of days, so may take some time to reply.

youngdjn commented 3 years ago

This looks fantastic! I am excited to draw from this to port our workflow to an object-oriented approach. Thanks for working on this and sharing. It's also helpful to see the implementation of network processing. I will have time to port our workflow in a couple months, so I will probably be back then with questions. :)

PeterBetlem commented 3 years ago

Perfect - seeing as our aims (at least for the time being) were somewhat different, I went along with the stand-alone class functions. Feel free to shoot me any questions; just expect plenty of them in return - especially seeing as I have to deal with a Windows environment, and can therefore only do limited testing on a Linux setup... But had it not been for your inspiration, I'd never have gotten this far - so thanks! :)

Also, by scanning the yaml for "*path" options, and using the pathlib functions in read_yaml, it should be easy to incorporate your #25 through https://docs.python.org/3/library/pathlib.html#pathlib.Path.expanduser