Tree Disk Pith Detection
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-disk4-seg.jpg --model_path ./models/yolo11s-det-pith.pt
Advanced usage with custom parameters:
tree-disk-pith \
--input_image input/tree-disk3.png \
--model_path ./models/yolo11s-det-pith.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
- Create and activate virtual environment:
poetry config virtualenvs.in-project true
poetry env use python
poetry install
eval $(poetry env activate)
- Running tests:
pytest
- fetch dataset
python fetch_dataset.py
- Download pretrained model
python fetch_pretrained_model.py
Metadata
Release files for tree-disk-pith 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tree_disk_pith-0.2.1.tar.gz | 8.4 kB | With provenance | Details for tree_disk_pith-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tree_disk_pith-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for tree_disk_pith-0.2.1-py3-none-any.whl |
Total release size: 20.0 kB
Release files / tree_disk_pith-0.2.1.tar.gz
| Download URL | tree_disk_pith-0.2.1.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0d14a94f676141317107316aac98ecc5abdddf4d09eae79b96b901135b74267
|
|
BLAKE2b-256 checksum How to use checksums |
56a38339c6fe3928af994b7fc63af4aea920b5c278fd486d5a5887673b0003f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 26, 2025.
Transparency logRelease files / tree_disk_pith-0.2.1-py3-none-any.whl
| Download URL | tree_disk_pith-0.2.1-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8cd2efa85db56ea3bfcf48f8279e54bba68ecbc1f36f3b88c0ae664d2ade23ab
|
|
BLAKE2b-256 checksum How to use checksums |
8624d0f3fa79986aadb3382d217b1f26b7dc4a97ab10158bfb53fbf15254e46b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 26, 2025.
Transparency logSecurity for tree-disk-pith 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for tree_disk_pith-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 26, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.