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",
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
- Clone the repository:
git clone https://github.com/tuke307/tree-disk-pith.git
cd tree-disk-pith
- Create and activate virtual environment:
poetry install
poetry shell
- fetch dataset
python fetch_dataset.py
- Download pretrained model
python fetch_pretrained_model.py
Project details
Release history Release notifications | RSS feed
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
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69092564d3d3e5c410588df980d8303fa6c96bf58b6555413572dbc060f274d3 |
|
MD5 | 40b492ba70a039359bd44ac043856b65 |
|
BLAKE2b-256 | 97d30d5d255c4bcce55350ad0953052f45674c82e59c27612ef7cbb7a7a1e70c |
Provenance
The following attestation bundles were made for tree_disk_pith-0.1.3.tar.gz
:
Publisher:
publish.yml
on tuke307/tree-disk-pith
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
tree_disk_pith-0.1.3.tar.gz
- Subject digest:
69092564d3d3e5c410588df980d8303fa6c96bf58b6555413572dbc060f274d3
- Sigstore transparency entry: 147694253
- Sigstore integration time:
- Predicate type:
File details
Details for the file tree_disk_pith-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: tree_disk_pith-0.1.3-py3-none-any.whl
- Upload date:
- Size: 31.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a5416bd82a1c83ca854b1051fa8b93b815fb9fc29a0db53594ca2862809fa31 |
|
MD5 | c787c7cb6eb2f842a4c2c9ef28121832 |
|
BLAKE2b-256 | 3f0249b9ad7e580389bb2b4f3bc4501ba1794fc1991e2f43c85dc1ac8e636da8 |
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
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
tree_disk_pith-0.1.3-py3-none-any.whl
- Subject digest:
8a5416bd82a1c83ca854b1051fa8b93b815fb9fc29a0db53594ca2862809fa31
- Sigstore transparency entry: 147694254
- Sigstore integration time:
- Predicate type: