Skip to main content

A package for tree disk pith detection in images

Project description

Tree Disk Pith Detection

PyPI - Version

A Python package for analyzing tree rings in cross-sectional images. Originally forked from hmarichal93/apd.

Installation

pip install tree-disk-pith

Usage

Python API

import treediskpith

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

# Run the detection
(
    img_in,          # Original input image
    img_pre,         # Preprocessed image
    pith,  # Center of the tree disk
) = treediskpith.run()

Command Line Interface (CLI)

Basic usage:

tree-disk-pith --input_image ./input/tree-disk3.png --new_shape 640 --debug

Save intermediate results:

tree-disk-pith --input_image ./input/tree-disk3.png --new_shape 640 --debug --method apd_pcl --save_results

Advanced usage with custom parameters:

tree-disk-pith \
    --input_image input/tree-disk3.png \
    --cx 1204 \
    --cy 1264 \
    --output_dir custom_output/ \
    --sigma 4.0 \
    --th_low 10 \
    --th_high 25 \
    --save_results \
    --debug

CLI Arguments

Argument Type Required Default Description
--input_image str Yes - Input image file path
--output_dir str Yes - Output directory path
--method str No apd Detection method to use. Choices are apd, apd_pcl, or apd_dl
--model_path str No - Path to the weights file (required if using apd_dl method)
--percent_lo float No 0.7 percent_lo parameter for the algorithm
--st_w int No 3 st_w parameter for the algorithm
--lo_w int No 3 lo_w parameter for the algorithm
--st_sigma float No 1.2 st_sigma parameter for the algorithm
--new_shape int No 0 New shape for resizing the input image. If 0, no resizing is done
--debug flag No False Enable debug mode to save intermediate images and outputs
--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-pith.git
cd tree-disk-pith
  1. Create and activate virtual environment:
poetry install
poetry shell
  1. fetch dataset
python fetch_dataset.py
  1. Download pretrained model
python fetch_pretrained_model.py

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_pith-0.1.3.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

tree_disk_pith-0.1.3-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file tree_disk_pith-0.1.3.tar.gz.

File metadata

  • Download URL: tree_disk_pith-0.1.3.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for tree_disk_pith-0.1.3.tar.gz
Algorithm Hash digest
SHA256 69092564d3d3e5c410588df980d8303fa6c96bf58b6555413572dbc060f274d3
MD5 40b492ba70a039359bd44ac043856b65
BLAKE2b-256 97d30d5d255c4bcce55350ad0953052f45674c82e59c27612ef7cbb7a7a1e70c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_disk_pith-0.1.3.tar.gz:

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

Attestations:

File details

Details for the file tree_disk_pith-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for tree_disk_pith-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8a5416bd82a1c83ca854b1051fa8b93b815fb9fc29a0db53594ca2862809fa31
MD5 c787c7cb6eb2f842a4c2c9ef28121832
BLAKE2b-256 3f0249b9ad7e580389bb2b4f3bc4501ba1794fc1991e2f43c85dc1ac8e636da8

See more details on using hashes here.

Provenance

The following attestation bundles were made for tree_disk_pith-0.1.3-py3-none-any.whl:

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

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