A library to preprocess image data.
Project description
Paidiverpy is a Python package designed to create pipelines for preprocessing image data for biodiversity analysis.
IMPORTANT: This package is still in active development, and frequent updates and changes are expected. The API and features may evolve as we continue improving it.
Documentation
The official documentation is hosted on ReadTheDocs.org: https://paidiverpy.readthedocs.io/
IMPORTANT: Comprehensive documentation is under construction.
Installation
To install paidiverpy, run:
pip install paidiverpy
Build from Source
Clone the repository:
# https git clone https://github.com/paidiver/paidiverpy.git cd paidiverpy(Optional) Create a Python virtual environment to manage dependencies separately from other projects. For example, using conda:
conda env create -f environment.yml conda activate PaidiverpyInstall the paidiverpy package:
pip install -e .
Usage
You can run your preprocessing pipeline using Paidiverpy in several ways, typically requiring just one to three lines of code:
Python Package
Install the package and utilize it in your Python scripts.
# Import the Pipeline class
from paidiverpy.pipeline import Pipeline
# Instantiate the Pipeline class with the configuration file path
# Please refer to the documentation for the configuration file format
pipeline = Pipeline(config_file_path="../examples/config_files/config_simple2.yml")
# Run the pipeline
pipeline.run()
You can export the output images to the specified output directory:
pipeline.save_images(image_format="png")
Command Line Interface (CLI)
Pipelines can be executed via command-line arguments. For example:
paidiverpy -c "examples/config_files/config_simple.yml"
This runs the pipeline according to the configuration file, saving output images to the directory defined in the output_path.
Docker
You can run Paidiverpy using Docker by pulling a pre-built image from GitHub Container Registry (GHCR) or Docker Hub.
docker pull ghcr.io/paidiver/paidiverpy:latest
docker tag ghcr.io/paidiver/paidiverpy:latest paidiverpy:latest
To run the container, use the following command:
docker run --rm \
-v <INPUT_PATH>:/app/input/ \
-v <OUTPUT_PATH>:/app/output/ \
-v <METADATA_PATH>:/app/metadata/ \
-v <CONFIG_DIR>:/app/config_files/ \
paidiverpy -c /app/examples/config_files/<CONFIG_FILE>
Example Data
If you’d like to manually download example data for testing, you can use the following command:
`python from paidiverpy.utils.data import PaidiverpyData PaidiverpyData().load(DATASET_NAME) `
Available datasets:
plankton_csv: Plankton dataset with CSV file metadata
benthic_csv: Benthic dataset with CSV file metadata
benthic_ifdo: Benthic dataset with IFDO metadata
nef_raw: Sample images in Nef format (raw images) with CSV file metadata
benthic_raw_images: Benthic dataset in raw format with CSV file metadata
Example data will be automatically downloaded when running the example notebooks.
IMPORTANT: Please check the documentation for more information about Paidiverpy: https://paidiverpy.readthedocs.io/
Gallery
Together with the documentation, you can explore various use cases through sample notebooks in the examples/example_notebooks directory:
Contributing to paidiverpy
Want to support or improve paidiverpy? Check out our contribution guide to learn how to get started.
Acknowledgements
This project was supported by the UK Natural Environment Research Council (NERC) through the Tools for automating image analysis for biodiversity monitoring (AIAB) Funding Opportunity, reference code UKRI052.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paidiverpy-0.2.0.tar.gz.
File metadata
- Download URL: paidiverpy-0.2.0.tar.gz
- Upload date:
- Size: 16.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f07c3db678d937582cb834b4ea6a63ea3161fce9254995e6819d5bc570ce2b2d
|
|
| MD5 |
353a5376f02b2e7aacd510b7c072234c
|
|
| BLAKE2b-256 |
3790767074db040cbd189b2a2733c6fdc34a451b4c281650d2c6aa07af4792f2
|
File details
Details for the file paidiverpy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: paidiverpy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 133.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cd2bd2a9091943e6c7256674b6cb353c03e4677c763ea045a7b1f251990d700
|
|
| MD5 |
a9bcbc461bc44dcc9fef0b3248a35817
|
|
| BLAKE2b-256 |
f17130a5fa39a81ea7c73b0792b49b00d40709d1428661762406cc43cf8b67f6
|