-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6be7597
Showing
122 changed files
with
20,552 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: adac4c8459f20da2a85f5ca9f7ac218e | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
# Minerva | ||
|
||
![GitHub release (latest by date)](https://img.shields.io/github/v/release/Pale-Blue-Dot-97/Minerva?) | ||
![GitHub](https://img.shields.io/github/license/Pale-Blue-Dot-97/Minerva?) | ||
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/minerva) | ||
![GitHub contributors](https://img.shields.io/github/contributors/Pale-Blue-Dot-97/Minerva?) | ||
[![CodeFactor](https://www.codefactor.io/repository/github/pale-blue-dot-97/minerva/badge)](https://www.codefactor.io/repository/github/pale-blue-dot-97/minerva) | ||
![tests](https://github.com/Pale-Blue-Dot-97/Minerva/actions/workflows/tests.yml/badge.svg) | ||
[![Read the Docs](https://img.shields.io/readthedocs/smp?)](https://pale-blue-dot-97.github.io/Minerva/) | ||
[![Qodana](https://github.com/Pale-Blue-Dot-97/Minerva/actions/workflows/code_quality.yml/badge.svg)](https://github.com/Pale-Blue-Dot-97/Minerva/actions/workflows/code_quality.yml) | ||
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/Pale-Blue-Dot-97/Minerva/tree/main.svg?style=svg&circle-token=7c738d256a0d8df674b2682daeb2f4b52381ced4)](https://dl.circleci.com/status-badge/redirect/gh/Pale-Blue-Dot-97/Minerva/tree/main) | ||
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | ||
[![Coverage Status](https://coveralls.io/repos/github/Pale-Blue-Dot-97/Minerva/badge.svg?t=ZycdOW)](https://coveralls.io/github/Pale-Blue-Dot-97/Minerva) | ||
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit) | ||
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Pale-Blue-Dot-97/Minerva/main.svg)](https://results.pre-commit.ci/latest/github/Pale-Blue-Dot-97/Minerva/main) | ||
|
||
<!-- PROJECT LOGO --> | ||
<br /> | ||
<div align="center"> | ||
<a href="https://github.com/Pale-Blue-Dot-97/Minerva"> | ||
<img src="docs/images/Minerva_logo.png" alt="Logo" width="" height="400"> | ||
</a> | ||
<p align="center"> | ||
<b style="font-size:26px;"> v0.25</b> | ||
<br /> | ||
<a href="https://pale-blue-dot-97.github.io/Minerva/"><strong>Explore the docs »</strong></a> | ||
<br /> | ||
<br /> | ||
<a href="https://github.com/Pale-Blue-Dot-97/Minerva/issues">Report Bug</a> | ||
· | ||
<a href="https://github.com/Pale-Blue-Dot-97/Minerva/issues">Request Feature</a> | ||
</p> | ||
</div> | ||
|
||
## About 🔎 | ||
|
||
Minerva is a package to aid in the building, fitting and testing of neural network models on multi-spectral geo-spatial data. | ||
|
||
## Getting Started ▶ | ||
|
||
If one wishes to use [torchgeo](https://pypi.org/project/torchgeo/), installation on Linux is recommended to handle the | ||
compilation of the required C-based libraries. | ||
|
||
### Installation ⬇ | ||
|
||
`minerva` is currently not included in any distribution. The recommended install is therefore to install the latest version from `GitHub`. | ||
|
||
```shell | ||
pip install git+https://github.com/Pale-Blue-Dot-97/Minerva.git | ||
``` | ||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> | ||
|
||
### Requirements 📌 | ||
|
||
`minerva` now supports the use of [torchgeo](https://torchgeo.readthedocs.io/en/latest/) | ||
datasets with upcoming support for [torchvision](https://pytorch.org/vision/stable/index.html) datasets. | ||
|
||
Required Python modules for `minerva` are stated in the `setup.cfg`. | ||
|
||
`minerva` currently only supports `python` 3.8 -- 3.11. | ||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> | ||
|
||
## Usage 🖥 | ||
|
||
The core functionality of `minerva` provides the modules to define `models` to fit and test, `loaders` to pre-process, | ||
load and parse data, and a `Trainer` to handle all aspects of a model fitting. Below is a MWE of creating datasets, | ||
initialising a Trainer and model, and fitting and testing that model then outputting the results: | ||
|
||
### MWE Driver Script 📄 | ||
|
||
```python | ||
from minerva.utils import CONFIG # Module containing various utility functions. | ||
from minerva.trainer import Trainer # Class designed to handle fitting of model. | ||
|
||
|
||
# Initialise a Trainer. Also creates the model. | ||
trainer = Trainer(**CONFIG) | ||
|
||
# Run the fitting (train and validation epochs). | ||
trainer.fit() | ||
|
||
# Run the testing epoch and output results. | ||
trainer.test() | ||
``` | ||
|
||
See `scripts\MinervaExp.py` as an example script implementing `minerva`. | ||
|
||
### Config Structure ⚙ | ||
|
||
See `minerva\inbuilt_cfgs\example_config.yml` as an example config file. | ||
|
||
### Creating a Manifest for your Dataset 📑 | ||
|
||
Use `scripts\ManifestMake.py` to construct a manifest to act as a look-up table for a dataset. | ||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> | ||
|
||
<!-- CONTRIBUTING --> | ||
## Contributing 🤝 | ||
|
||
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. | ||
|
||
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". | ||
Don't forget to give the project a star! Thanks again! | ||
|
||
1. Fork the Project | ||
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) | ||
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) | ||
4. Push to the Branch (`git push origin feature/AmazingFeature`) | ||
5. Open a Pull Request | ||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> | ||
|
||
## License 🔏 | ||
|
||
Minerva is distributed under a [MIT License](https://choosealicense.com/licenses/mit/). | ||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> | ||
|
||
## Authors ✒ | ||
|
||
Created by Harry Baker as part of a project towards for a PhD in Computer Science from the | ||
University of Southampton. Funded by the Ordnance Survey Ltd. | ||
|
||
Contributions also provided by: | ||
|
||
- [Jo Walsh](https://github.com/metazool) | ||
- [Navid Rahimi](https://github.com/NavidCOMSC) | ||
- [Isabel Sargent](https://github.com/PenguinJunk) | ||
- [Steve Coupland](https://github.com/scoupland-os) | ||
- [Joe Guyatt](https://github.com/joeguyatt97) | ||
- [Ben Dickens](https://github.com/BenDickens) | ||
- [Kitty Varghese](https://github.com/kittyvarghese) | ||
|
||
## Acknowledgments 📢 | ||
|
||
I'd like to acknowledge the invaluable supervision and contributions of [Prof Jonathon Hare](https://github.com/jonhare) and | ||
[Dr Isabel Sargent](https://github.com/PenguinJunk) towards this work. | ||
|
||
The following modules are adapted from open source third-parites: | ||
| Module | Original Author | License | Link | | ||
|:-------|:----------------|:--------|:-----| | ||
| `pytorchtools` | [Noah Golmant](https://github.com/noahgolmant) | MIT | https://github.com/noahgolmant/pytorch-lars/blob/master/lars.py | | ||
| `optimisers` | [Bjarte Mehus Sunde](https://github.com/Bjarten) | MIT | https://github.com/Bjarten/early-stopping-pytorch | | ||
|
||
This repositry also contains two small ``.tiff`` exercpts from the [ChesapeakeCVPR](https://lila.science/datasets/chesapeakelandcover) dataset used for unit testing purposes. Credit for this data goes to: | ||
|
||
> Robinson C, Hou L, Malkin K, Soobitsky R, Czawlytko J, Dilkina B, Jojic N. | ||
Large Scale High-Resolution Land Cover Mapping with Multi-Resolution Data. | ||
Proceedings of the 2019 Conference on Computer Vision and Pattern Recognition (CVPR 2019) | ||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> | ||
|
||
## Project Status 🔴🟡🟢 | ||
|
||
This project is now in release *beta* state. Still expect some bugs and there may be breaking changes in future versions. | ||
|
||
<p align="right">(<a href="#top">back to top</a>)</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.. Minerva documentation master file, created by | ||
sphinx-quickstart on Tue Mar 29 18:44:06 2022. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root ``toctree`` directive. | ||
.. include:: readme_link.rst | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
:caption: Source Documentation 📙: | ||
|
||
source/minerva/datasets | ||
source/minerva/logger | ||
source/minerva/metrics | ||
source/minerva/modelio | ||
source/minerva/optimisers | ||
source/minerva/pytorchtools | ||
source/minerva/samplers | ||
source/minerva/trainer | ||
source/minerva/transforms | ||
source/minerva/models/index | ||
source/minerva/utils/index | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
:caption: Guides and Information 📗: | ||
|
||
source/guides/index | ||
source/glossary | ||
|
||
Indices and tables 📚 | ||
===================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.. include:: docs_readme.md | ||
:parser: myst_parser.sphinx_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Glossary | ||
======== | ||
|
||
.. note:: | ||
This glossary is very much WIP and incomplete! | ||
|
||
.. glossary:: | ||
|
||
patch | ||
patches | ||
A section of land, cut from a larger :term:`tile`. | ||
|
||
tile | ||
A large section of planetary surface, often defining a basic unit of a geo-referencing system. | ||
|
||
collapse level | ||
A metric of how close outputs from a Siamese model are to collapsing to a trivial solution. | ||
|
||
euclidean distance | ||
The Euclidean distance between two vectors. | ||
|
||
MIoU | ||
Mean Intersection over Union. Measure of the colloration between predicted and ground truth labels | ||
in segmentation masks. | ||
|
||
OHE | ||
One-hot-encoding. A method of encoding information in vectors of length ``N`` where ``N`` is the number | ||
of possible classes. A label for class ``n`` is represented by a ``1`` placed in the ``n-th`` dimension | ||
of the vector, with all other dimensions being ``0``. |
Oops, something went wrong.