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",
    model_path="models/apd_dl.h5",
    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 --model_path ./models/all_best_yolov8.pt

Advanced usage with custom parameters:

tree-disk-pith \
    --input_image input/tree-disk3.png \
    --model_path ./models/all_best_yolov8.pt \
    --output_dir custom_output/ \
    --new_shape 640 \
    --save_results \
    --debug

CLI Arguments

Argument Type Required Default Description
--input_image str Yes - Input image file path
--output_dir str Yes ./output Output directory path
--model_path str No - Path to the weights file (required if using apd_dl method)
--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. Create and activate virtual environment:
poetry config virtualenvs.in-project true
poetry env use python
poetry install
eval $(poetry env activate)
  1. Running tests:
pytest
  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.6.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

tree_disk_pith-0.1.6-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tree_disk_pith-0.1.6.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tree_disk_pith-0.1.6.tar.gz
Algorithm Hash digest
SHA256 f1777b9466c1642a8407768d2a20d1895de0ad42f5a17361698a1c20ccb1219c
MD5 be7d14bbb0a6a9a1e78f44e3394c214d
BLAKE2b-256 a4d866a7712a7f5fbee3124a275e0b51cd049030342f5994fa7365c4f9756f5a

See more details on using hashes here.

Provenance

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

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: tree_disk_pith-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tree_disk_pith-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fc21430c92e96f28d4644b4756553fe3bd03ae6ca4f94bb905750ce1d426eb92
MD5 fd26346d15eb3aa58fd3535d660880cb
BLAKE2b-256 80fb12ef3d7a886e6a1b9c83c74389ea5eed98851607c363fe20e481f886c312

See more details on using hashes here.

Provenance

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

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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