pyPetrograph
v0.0.6
pyPetrograph is a machine-learning toolkit for thin-section petrography.
Warning: This tool is under development. Use with caution. APIs and numbers can still change.
What it does
Hand-label features and map their area %. Paint a few examples of each class you care about (pores, grains, cement, …) from color, edge sharpness, and microtexture. A LightGBM pixel classifier (random forest or XGBoost optional) maps the rest of the photo and reports area % of each class.
Count grains on a painted mineral map. Match pixels to a color legend, split grains that touch, and count how many grains sit in each class.
Segment grains from a multi-image overlay. Line up several image types of the same field (plane-polarized light, crossed polars, or others) and refine grain outlines with a U-Net, so boundaries are not drawn from one lighting alone.
For finer grain-boundary mapping there is optional support for SegmentEveryGrain (Zoltan Sylvester). SAM 2.1 weights (~860 MB) are a further opt-in on their page, not part of the default install.
Install
pip install pypetrograph
pip install segmenteverygrain
The second line is optional (SegmentEveryGrain’s existing-environment path).
Demos
Example notebooks, test images, and figures are in the GitHub repository.
Credits
The current version is primarily developed by Larry Syu-Heng Lai, based on early source code scripted by Zoltan Sylvester, at the Quantitative Clastic Laboratory, Bureau of Economic Geology, The University of Texas at Austin. This development is also part of a collaboration with Priyanka Periwal, Lucy Tingwei Ko, Kelly Hattori, and Amanda Calle across multiple research groups and the e-MAGE lab in the Bureau of Economic Geology.
License
GNU Affero General Public License 3.0 or later (LICENSE).
Metadata
Release files for pyPetrograph 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pypetrograph-0.0.6.tar.gz | 132.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pypetrograph-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 287.9 kB
Release files / pypetrograph-0.0.6.tar.gz
| Download URL | pypetrograph-0.0.6.tar.gz |
|---|---|
| Size | 132.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35dc48d0e132c4d2e0487d2f790fff058926fcff39a1aa14363b18cd7fee10cc
|
|
BLAKE2b-256 checksum How to use checksums |
a1f0b01a9247f6a9ea0a1b2c5a673a508d9939099eee5fe87e2ccb63bf1a26e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / pypetrograph-0.0.6-py3-none-any.whl
| Download URL | pypetrograph-0.0.6-py3-none-any.whl |
|---|---|
| Size | 155.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d37ec92cddf3141b9bde311a57671b198af6e0bb432e449e09e0a7ebaf33142f
|
|
BLAKE2b-256 checksum How to use checksums |
d43a51cbb7613f97e7335f6e8929591a1918925fbe2e39ee2a39e81ef264d59a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Security for pyPetrograph 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.