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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: tree_disk_pith-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 26d97302c7c243dfc6f9a0df2bd1ef5fc9f41d4be947857e49cfe7fe4684dab0
MD5 6ca9fc47a4aa9b36e8eb1d7a9160681f
BLAKE2b-256 783d5fcf5a06d33487c031251435af4464a7f664ecdb656f62a45387a0ab5420

See more details on using hashes here.

Provenance

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

Publisher: publish_pith.yml on tuke307/tree-disk-analyzer

Attestations:

File details

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

File metadata

File hashes

Hashes for tree_disk_pith-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b34bfed797ec1b06d09e19cd544be3b6af66d531995a09ecdd8d898dfc94e145
MD5 9a1f0a0ab1314f6810e45012d011d946
BLAKE2b-256 96f3c80a37ffcd015402e86017a1104847b94298080c321c12b8de520e2fe9b6

See more details on using hashes here.

Provenance

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

Publisher: publish_pith.yml on tuke307/tree-disk-analyzer

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