Pycoeus
Segment (georeferenced) raster data in an interactive fashion. Retrain models in seconds. Only small amounts of labeled data necessary because of our use of pretrained base models as feature extractors. Pycoeus can be used as a standalone commandline tool or as the backend for the QGIS plugin called CoeusAI.
The project setup is documented in project_setup.md.
Typical usage
Let's say you've got the image on the left, along with the labels (superimposed on the image) on the right.
You run the commandline tool as follows, selecting both input image and labels, the path where the output should be, and the type of features to use.
python main.py --input image.tif --labels labels.tif --predictions output.tif
The resulting output looks like:
To test this with our testdata, run:
python src/pycoeus/main.py --input tests/test_data/test_image.tif -l tests/test_data/test_image_labels.tif -p output.tif
Installation
There are 2 ways to install pycoeus. Either run:
pip install pycoeus
Or run:
git clone git@github.com:DroneML/pycoeus.git
cd pycoeus
python -m pip install .
Logging
The application writes logs to the 'logs' dir, which will be created if it doesn't exist yet. Messages printed to the screen (stdout) are stored in info.log for later reference. More detailed information, such as input data shapes and value distributions, are written to debug.log.
Train a feature extraction model
To train a feature extraction model run the script "train_model.py" in this repo:
python ./src/pycoeus/utils/train_model.py -r ../monochrome_flair_1_toy_dataset_flat/ --train_set_limit 10
This assumes a 'flat', grayscale, version of the FLAIR1 dataset is present at the selected root location.
root
- train
- input
- IMG_061946_0.tif
- IMG_061946_1.tif
- ...
- labels
- MSK_061946_0.tif
- ...
Use the script 'monochromize.py' to create greyscale (single band) tifs for every multiband tif in a source folder:
python ./src/pycoeus/utils/monochromize.py -i ../flair_1_toy_dataset/ -o ../monochrome_flair_1_toy_dataset/
Credits
This package was created with Copier and the NLeSC/python-template.
Metadata
Release files for pycoeus 0.6.0
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 | Actions |
|---|---|---|---|---|
| pycoeus-0.6.0.tar.gz | 4.6 MB | Without provenance | Details for pycoeus-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pycoeus-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for pycoeus-0.6.0-py3-none-any.whl |
Total release size: 4.7 MB
Release files / pycoeus-0.6.0.tar.gz
| Download URL | pycoeus-0.6.0.tar.gz |
|---|---|
| Size | 4.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f3f07f0db230a55341185c1c1126c0088f4780c3bc846dfaf0cfcfd2c4578c9
|
|
BLAKE2b-256 checksum How to use checksums |
32246e3abe55432edb2749d7e3001a0fea0ecfeeb9a7dc695ec27c36d9fc3413
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / pycoeus-0.6.0-py3-none-any.whl
| Download URL | pycoeus-0.6.0-py3-none-any.whl |
|---|---|
| Size | 28.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a7657d2a7e7c95fc98d71ef0ff4c82c6bf5f60944b374b70f39a5f0d7fef4e9
|
|
BLAKE2b-256 checksum How to use checksums |
192a5e47618bdf8e3396e5cfa8c0f9c6020befe67236d551e1b0af7d7477a3e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for pycoeus 0.6.0
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.