Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tree-disk-pith

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-disk-pith

A package for tree disk pith detection in images

  • 0.1.4
  • PyPI
  • Socket score

Maintainers
1

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",
    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

ArgumentTypeRequiredDefaultDescription
--input_imagestrYes-Input image file path
--output_dirstrYes-Output directory path
--methodstrNoapdDetection method to use. Choices are apd, apd_pcl, or apd_dl
--model_pathstrNo-Path to the weights file (required if using apd_dl method)
--percent_lofloatNo0.7percent_lo parameter for the algorithm
--st_wintNo3st_w parameter for the algorithm
--lo_wintNo3lo_w parameter for the algorithm
--st_sigmafloatNo1.2st_sigma parameter for the algorithm
--new_shapeintNo0New shape for resizing the input image. If 0, no resizing is done
--debugflagNoFalseEnable debug mode to save intermediate images and outputs
--save_resultsflagNoFalseSave intermediate images, labelme and config file

Development

Setting up Development Environment

  1. Clone the repository:
git clone https://github.com/tuke307/tree-disk-pith.git
cd tree-disk-pith
  1. Create and activate virtual environment:
poetry install
poetry shell
  1. fetch dataset
python fetch_dataset.py
  1. Download pretrained model
python fetch_pretrained_model.py

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc