Skip to content

Commit d093f07

Browse files
committed
Initial commit with all current files, first public release
0 parents  commit d093f07

22 files changed

Lines changed: 1859 additions & 0 deletions

.gitignore

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
#uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# pdm
111+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112+
#pdm.lock
113+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114+
# in version control.
115+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116+
.pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
activate
139+
140+
# Spyder project settings
141+
.spyderproject
142+
.spyproject
143+
144+
# Rope project settings
145+
.ropeproject
146+
147+
# mkdocs documentation
148+
/site
149+
150+
# mypy
151+
.mypy_cache/
152+
.dmypy.json
153+
dmypy.json
154+
155+
# Pyre type checker
156+
.pyre/
157+
158+
# pytype static type analyzer
159+
.pytype/
160+
161+
# Cython debug symbols
162+
cython_debug/
163+
164+
# PyCharm
165+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
166+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
167+
# and can be added to the global gitignore or merged into this file. For a more nuclear
168+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
169+
#.idea/
170+
171+
# PyPI configuration file
172+
.pypirc

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 British Antarctic Survey
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
![wildlife from space ai logo](docs/img/wildlife-from-space-ai-logo-small.png)
2+
3+
## **W**ildlife **F**rom **S**pace **AI** - **wfsai**
4+
A pip installable python package to help with the AI workflow stages of detecting Wildlife from Space.
5+
6+
The features of the `wfsai` package include:
7+
8+
- Handling configuration based AI pipeline workflow/execution.
9+
- Setting up reproducible file/directory compute environments.
10+
- Retrieving local and remote datasets/configs.
11+
- Ortho-rectification of VHR satellite imagery (using GDAL).
12+
- Pan-sharpening of VHR satellite imagery (using GDAL, "weighted" Brovey algorithm).
13+
- Tiling of VHR satellite imagery.
14+
- Masking of VHR satellite imagery to shapefile with optional shapefile dilation.
15+
16+
---
17+
18+
Documentation for this package is temporarily hosted [here]()
19+
20+
---
21+
22+
This python package aims to integrate with the common AI workflow shown in the diagram below:
23+
24+
![Typical AI Image analysis workflow](docs/img/A.I.-Model-768x432.png)
25+
(diagram courtesy of [this](https://blogs.oregonstate.edu/gemmlab/2024/12/23/demystifying-ai-a-brief-overview-of-image-pre-processing-and-a-machine-learning-workflow/) blogpost. original diagram [here](https://osu-wams-blogs-uploads.s3.amazonaws.com/blogs.dir/2115/files/2024/12/A.I.-Model-768x432.png))
26+
27+
---
28+
29+
## Installation
30+
Requires Python >=3.10
31+
32+
> ### pip
33+
> `pip install git+https://github.com/antarctica/wfsai.git@main`
34+
35+
> ### conda/mamba
36+
> `conda/mamba create -n <environment-name> -c conda-forge git pip`
37+
> `conda/mamba activate <environment-name>`
38+
> `pip install git+https://github.com/antarctica/wfsai.git@main`
39+
40+
### GDAL
41+
Some of the modules within this `wfsai` package make use of the **gdal** python implementation, including it's underlying dependencies. We found that the best way to handle **gdal** and it's dependencies is to use a mamba environment with the mamba dependency solver. If you are using a conda/mamba environment in your project then simply include **gdal** as a dependency in your environment.yaml or use the command:
42+
> `conda install -n <environment-name> -c conda-forge gdal`
43+
44+
## Environment Variables
45+
If retrieving a configuration from a remote repository then specify the `REMOTE_CONFIG_REPO` environment variable.
46+
```bash
47+
REMOTE_CONFIG_REPO=<url>
48+
```
49+
With either remote or local config files, you should specify the `CONFIG_FILE` environment variable.
50+
```bash
51+
CONFIG_FILE=<config filename>
52+
```
53+
54+
From the diagram above, often the first step of AI workflow is to obtain a source dataset to answer a scientific question. Datasets may be remote or local to the working environment and it is helpful to set out a framework for how the data will be handled during the workflow.
55+
For example:
56+
- `configuration files -> retrieving/linking of input files -> intermediate files -> outputs.`
57+
58+
## Usage (cli)
59+
### wfsai **--help**
60+
*show the built-in help for the wfsai package command line interface (cli)*

docs/development.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Development
2+
3+
Depends on:
4+
5+
* Python >=3.10
6+
7+
---
8+
9+
1. Create and activate a python virtual environment of your choice.
10+
1. Inside the virtual environment or machine:
11+
- Install an editable version of simple-action-pipeline.
12+
`git clone https://github.com/antarctica/wfsai ./wfsai`
13+
`cd ./wfsai`
14+
`pip install -e .`
15+
- Use `pip install -e ".[documentation]"` to edit/contribute to the documentation.
16+
17+
## Release/Versioning
18+
19+
Version numbers should be used in tagging commits on the `main` branch and should be of the form `v0.1.7` using the semantic versioning convention.
20+
21+
## Bugs & issues
22+
23+
If you find a bug, or would like to contribute please [raise an issue](https://github.com/antarctica/wfsai/issues/new) in the first instance.
24+
25+
## Building & deploying the documentation
26+
27+
Run `mkdocs build` to build the docs.
28+
29+
Then run `mkdocs gh-deploy` to deploy to the `gh-pages` branch of the repository. You must have write access to the repo.

docs/img/A.I.-Model-768x432.png

88 KB
Loading
20.7 KB
Loading
50.4 KB
Loading
947 KB
Loading

docs/implementation.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Implementation
2+
3+
## Python package
4+
`wfsai` is implemented as a pip installable python package. Using python version 3.8 or higher.
5+
6+
The use of the package is documented in the [Tutorial](tutorial.md) and [API REFERENCE](../autoapi/wfsai/) sections.
7+
8+
---
9+
10+
Most python modules are implemented as simple methods with arguments. Although the 'imagery' and 'shape' modules implement object classes as indicated below:
11+
12+
```python
13+
from wfsai import imagery
14+
from wfsai import shapes
15+
16+
# Set up maxar image processor
17+
m = imagery.maxar()
18+
19+
help(m)
20+
21+
# Set up the image tile processor
22+
t = imagery.tiling()
23+
24+
help(t)
25+
26+
# Set up the shapefile processor
27+
s = shapes.shapefile()
28+
29+
help(s)
30+
31+
```
32+
33+
---
34+
35+
## Command-Line Interface
36+
A basic shell command line interface has been implemented.
37+
38+
**`wfsai`** `--help`
39+
```bash
40+
usage: wfsai [-h] [-v] [-d DISPLAY] [--remote_config]
41+
42+
Command Line interface for Wildlife from Space AI tools
43+
44+
options:
45+
-h, --help show this help message and exit
46+
-v, --version show this package version and exit
47+
-d CONF_FILE, --display CONF_FILE display configuration
48+
--remote_config retrieve the remote configuration file
49+
50+
```
51+
52+
From the command-line you can:
53+
54+
- check the version of the wfsai package
55+
- display the formatted contents of a yaml config file
56+
- retrieve a remote config file (provided the 'REMOTE_CONFIG_REPO' and 'CONFIG_FILE' environment variables are set).

docs/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
![wildlife from space ai logo](img/wildlife-from-space-ai-logo-small.png)
2+
# wildlife-from-space-ai
3+
4+
A pip installable python package to help with the AI workflow stages of detecting Wildlife from Space.
5+
6+
7+
8+
## Using this documentation
9+
10+
Most of these docs are primarily aimed at developers and users of the wfsai python package. These docs can also be useful if you wish to extend or contribute towards this repository.

0 commit comments

Comments
 (0)