Skip to main content

A package for tree disk segmentation in images

Project description

Tree Disk Segmentation

PyPI - Version

A Python package for analyzing tree rings in cross-sectional images.

Installation

pip install tree-disk-segmentation

Usage

Python API

import treedisksegmentation

# Configure the analyzer
treedisksegmentation.configure(
    input_image="input/tree-disk4.png",
    save_results=True,
)

# Run the analysis
(
    img_in,          # Original input image
    img_pre,         # Preprocessed image
    devernay_edges,  # Detected edges
    devernay_curves_f,  # Filtered curves
    devernay_curves_s,  # Smoothed curves
    devernay_curves_c,  # Connected curves
    devernay_curves_p,  # Final processed curves
) = treedisksegmentation.run()

Command Line Interface (CLI)

Basic usage:

tree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output/output.jpg

Save intermediate results:

tree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output/output.jpg --model_path ./models/u2net.pth --save_results

CLI Arguments

Argument Type Required Default Description
--input_image str Yes - Path to input image
--output_dir str No ./output Output directory path
--model_path str No ./models/u2net.pth Path to the pre-trained model weights
--debug flag No False Enable debug mode
--save_results flag No False Save intermediate images, labelme and config file

Development

Setting up Development Environment

  1. Clone the repository:
git clone https://github.com/tuke307/tree-disk-segmentation.git
cd tree-disk-segmentation
  1. Create and activate virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install development dependencies:
pip install -r requirements.txt
  1. Install the package in editable mode:
pip install -e .

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

tree_disk_segmentation-0.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

tree_disk_segmentation-0.1.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file tree_disk_segmentation-0.1.1.tar.gz.

File metadata

File hashes

Hashes for tree_disk_segmentation-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3ed4b9a18ee7cb6e8699f50d2fe1ee1795fc3c14bb82a758aa5dea3dea61ae1d
MD5 eb2fae38a4256fd62d773bff32466e40
BLAKE2b-256 7a288c2fe5e58c2d1a1835007a1cb13a5c34af58c67f5601950bd51b4b934741

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_disk_segmentation-0.1.1.tar.gz:

Publisher: publish.yml on tuke307/tree-disk-segmentation

Attestations:

File details

Details for the file tree_disk_segmentation-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tree_disk_segmentation-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 203e51d08d13bf220936f1bdae352cb58997aed9fa3b3be6a92c274a5ad51038
MD5 fc1b762caaf209b0c9bc0c4a20fbd262
BLAKE2b-256 b8da1748945597ad33a8493eef74e0e3566e2d287e16f275b204d6eb2659c663

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_disk_segmentation-0.1.1-py3-none-any.whl:

Publisher: publish.yml on tuke307/tree-disk-segmentation

Attestations:

Supported by

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