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.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

tree_disk_segmentation-0.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for tree_disk_segmentation-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed30165afc5d61b32c5b706de5ae049017aff6977e72ff41d68f20d34ff36aa8
MD5 d19ac48cb258016225b4ecf8d59dd596
BLAKE2b-256 6a4f712e45160e6e74bc0d6d011c823c58083ce20138e5c75a7594ca5ae68ae9

See more details on using hashes here.

Provenance

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

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

Attestations:

File details

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

File metadata

File hashes

Hashes for tree_disk_segmentation-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0acd93b31c1468daeb732cb2cd38c9aef55974381a80704851a00a4ba4c94055
MD5 a3987371d01927cede9997c757f6a7e0
BLAKE2b-256 c22d14a1a06f0e65acde850308d74f2eb564a30fb6a46eef6aec766d6cb78fe6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_disk_segmentation-0.1.0-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