Skip to main content

A library to preprocess image data.

Project description

Paidiverpy

lifecycle License Documentation DOIlink Pypi covlink

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

  1. Clone the repository:

    # https
    git clone https://github.com/paidiver/paidiverpy.git
    cd paidiverpy
  2. (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 Paidiverpy
  3. Install 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/

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

paidiverpy-0.2.1.tar.gz (16.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paidiverpy-0.2.1-py3-none-any.whl (133.7 kB view details)

Uploaded Python 3

File details

Details for the file paidiverpy-0.2.1.tar.gz.

File metadata

  • Download URL: paidiverpy-0.2.1.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

Hashes for paidiverpy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ba130393c0bf7c625565186c5dd4cd2bb2079902022d7fb7c4b9b565415743f0
MD5 f8917d7d0632595febab157950f68a1d
BLAKE2b-256 b3b8fc8201634988106f9bc648dbea361ba82b6862ae97711bff1b4b1c21fa37

See more details on using hashes here.

File details

Details for the file paidiverpy-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: paidiverpy-0.2.1-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

Hashes for paidiverpy-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12def983cc798bb74224b40de4f256ac2e99d316e3f55ce29f366d2b7b4b3aa3
MD5 17d05ffe3df9aed26e323d1768066436
BLAKE2b-256 cd74295ecfee8284e5c07245a65e2828d4fbc89d531826f781eabda3f6c33cec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page