Tree Disk Segmentation
![PyPI - Version](https://img.shields.io/pypi/v/tree-disk-segmentation)
A Python package for analyzing tree rings in cross-sectional images.
Installation
pip install tree-disk-segmentation
Usage
Python API
import treedisksegmentation
treedisksegmentation.configure(
input_image="input/tree-disk4.png",
save_results=True,
)
(
img_in,
img_pre,
devernay_edges,
devernay_curves_f,
devernay_curves_s,
devernay_curves_c,
devernay_curves_p,
) = treedisksegmentation.run()
Command Line Interface (CLI)
Basic usage:
tree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output/output.jpg
Save intermediate results:
tree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output/output.jpg --model_path ./models/u2net.pth --save_results
CLI Arguments
Argument | Type | Required | Default | Description |
---|
--input_image | str | Yes | - | Path to input image |
--output_dir | str | No | ./output | Output directory path |
--model_path | str | No | ./models/u2net.pth | Path to the pre-trained model weights |
--debug | flag | No | False | Enable debug mode |
--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-segmentation.git
cd tree-disk-segmentation
- Create and activate virtual environment:
poetry install
poetry shell