A package for tree disk pith detection in images
Project description
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-disk3.png
Advanced usage with custom parameters:
tree-disk-pith \
--input_image input/tree-disk3.png \
--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 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tree_disk_pith-0.1.5.tar.gz.
File metadata
- Download URL: tree_disk_pith-0.1.5.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3406a8ac033157d4796fb275569206823418074c67ee5adb25d927f564d4562
|
|
| MD5 |
dc811d1298e9816a070bb6314f86200e
|
|
| BLAKE2b-256 |
448377e8cdabc381a50fcf0bb5b17ec5497b22e358163cfdb7618b55fb08fde2
|
Provenance
The following attestation bundles were made for tree_disk_pith-0.1.5.tar.gz:
Publisher:
publish_pith.yml on tuke307/tree-disk-analyzer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tree_disk_pith-0.1.5.tar.gz -
Subject digest:
f3406a8ac033157d4796fb275569206823418074c67ee5adb25d927f564d4562 - Sigstore transparency entry: 171374695
- Sigstore integration time:
-
Permalink:
tuke307/tree-disk-analyzer@3cbd08291ef7d15eac020e653ee965fb28d49f84 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tuke307
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pith.yml@3cbd08291ef7d15eac020e653ee965fb28d49f84 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tree_disk_pith-0.1.5-py3-none-any.whl.
File metadata
- Download URL: tree_disk_pith-0.1.5-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.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d1893186118d277254c33703e101ceff4f140725e0e8b7921a238c3a89b8668
|
|
| MD5 |
3c0a3936e89427511a35b12b76837257
|
|
| BLAKE2b-256 |
15d9b8bdc5dc173d88c8a162055bcc3f9c64ad6e2c388111940f53e12572c36f
|
Provenance
The following attestation bundles were made for tree_disk_pith-0.1.5-py3-none-any.whl:
Publisher:
publish_pith.yml on tuke307/tree-disk-analyzer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tree_disk_pith-0.1.5-py3-none-any.whl -
Subject digest:
7d1893186118d277254c33703e101ceff4f140725e0e8b7921a238c3a89b8668 - Sigstore transparency entry: 171374697
- Sigstore integration time:
-
Permalink:
tuke307/tree-disk-analyzer@3cbd08291ef7d15eac020e653ee965fb28d49f84 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tuke307
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_pith.yml@3cbd08291ef7d15eac020e653ee965fb28d49f84 -
Trigger Event:
push
-
Statement type: