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

Convert metashape workflow functions module into a python class #24

Open
youngdjn opened this issue Oct 31, 2019 · 7 comments
Open

Convert metashape workflow functions module into a python class #24

youngdjn opened this issue Oct 31, 2019 · 7 comments

Comments

@youngdjn
Copy link
Collaborator

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
Copy link

PeterBetlem commented Aug 21, 2020

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
Copy link
Collaborator Author

youngdjn commented Aug 24, 2020 via email

@youngdjn
Copy link
Collaborator Author

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

@PeterBetlem
Copy link

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
Copy link

The link above now links to a fully rewritten class that

  • supports both the Agisoft network batch submission and local use (compatible with the servers, I hope).
  • uses a logger rather than the write to file
  • supports the UCDavis config file, along with added support for Windows paths using the pathlib.Path function. To make this work, the read_yaml script has been updated to parse all parameters with 'path' as a a pathlib.Path(). Please let me know whether this also works on UNIX based machines :)
  • supports the UCDavis config file, along with added support for adding and/or removing/commenting parameters from the configuration. That means parameters no longer need to be hardcoded/present in the config file = no errors
  • currently only supports addPhotos, alignPhotos, addGCPs, optimizeCameras, buildDenseCloud, buildMesh, buildTexture, and export_report (others can be easily added, including the DEM in the original; at UNIS we just use it for outcrop photogrammetry, hence the focus being elsewhere).

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

@youngdjn
Copy link
Collaborator Author

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
Copy link

PeterBetlem commented Oct 26, 2020

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

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

No branches or pull requests

2 participants