# Tree Disk Segmentation
[](https://pypi.org/project/tree-disk-segmentation/)
A Python package for analyzing tree rings in cross-sectional images.
## Installation
```bash
pip install tree-disk-segmentation
```
## Usage
### Python API
```python
import treedisksegmentation
# Configure the analyzer
treedisksegmentation.configure(
input_image="input/tree-disk4.png",
save_results=True,
)
# Run the segmentation
(
result_image, # Image with detected tree disks
masks, # List of masks for each detected tree disk
) = treedisksegmentation.run()
```
### Command Line Interface (CLI)
Basic usage:
```bash
tree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output
```
Save intermediate results:
```bash
tree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output --model_path ./models/yolo11s-seg-tree.pt --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/yolo11s-seg-tree.pt` | 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
1. Create and activate virtual environment:
```bash
poetry config virtualenvs.in-project true
poetry env use python
```
```bash
poetry install
eval $(poetry env activate)
```
2. Running tests:
```bash
poetry run pytest
```
Raw data
{
"_id": null,
"home_page": null,
"name": "tree-disk-segmentation",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "tree, segmentation, image processing",
"author": "Tony",
"author_email": "tonymeissner70@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/4e/99/f57cd6ff0c2071eaf6fb6ed716ea87e7e45b7b1b42754efc099a5553460a/tree_disk_segmentation-0.2.1.tar.gz",
"platform": null,
"description": "# Tree Disk Segmentation\n\n[](https://pypi.org/project/tree-disk-segmentation/)\n\nA Python package for analyzing tree rings in cross-sectional images.\n\n## Installation\n\n```bash\npip install tree-disk-segmentation\n```\n\n## Usage\n\n### Python API\n\n```python\nimport treedisksegmentation\n\n# Configure the analyzer\ntreedisksegmentation.configure(\n input_image=\"input/tree-disk4.png\",\n save_results=True,\n)\n\n# Run the segmentation\n(\n result_image, # Image with detected tree disks\n masks, # List of masks for each detected tree disk\n) = treedisksegmentation.run()\n```\n\n### Command Line Interface (CLI)\n\nBasic usage:\n```bash\ntree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output\n```\n\nSave intermediate results:\n```bash\ntree-disk-segmentation --input_image ./input/baumscheibe.jpg --output_dir ./output --model_path ./models/yolo11s-seg-tree.pt --save_results\n```\n\n## CLI Arguments\n\n| Argument | Type | Required | Default | Description |\n|----------|------|----------|---------|-------------|\n| `--input_image` | str | Yes | - | Path to input image |\n| `--output_dir` | str | No | `./output` | Output directory path |\n| `--model_path` | str | No | `./models/yolo11s-seg-tree.pt` | Path to the pre-trained model weights |\n| `--debug` | flag | No | False | Enable debug mode |\n| `--save_results` | flag | No | False | Save intermediate images, labelme and config file |\n\n## Development\n\n### Setting up Development Environment\n\n1. Create and activate virtual environment:\n```bash\npoetry config virtualenvs.in-project true\npoetry env use python\n```\n\n```bash\npoetry install\neval $(poetry env activate)\n```\n\n2. Running tests:\n```bash\npoetry run pytest\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A package for tree disk segmentation in images",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/tuke307/tree-disk-analyzer",
"Repository": "https://github.com/tuke307/tree-disk-analyzer"
},
"split_keywords": [
"tree",
" segmentation",
" image processing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "57a538055bf62b9fe2da831cb96f9e4811a8d148d8714be18495af58be94fe22",
"md5": "ae0eec083ed3dbc9b3f492429cfe68d1",
"sha256": "a915e2db07ea275084d9f1c0123520a8978e71181b2b5eb302389e45417b3533"
},
"downloads": -1,
"filename": "tree_disk_segmentation-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ae0eec083ed3dbc9b3f492429cfe68d1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 9126,
"upload_time": "2025-02-25T18:40:34",
"upload_time_iso_8601": "2025-02-25T18:40:34.907541Z",
"url": "https://files.pythonhosted.org/packages/57/a5/38055bf62b9fe2da831cb96f9e4811a8d148d8714be18495af58be94fe22/tree_disk_segmentation-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4e99f57cd6ff0c2071eaf6fb6ed716ea87e7e45b7b1b42754efc099a5553460a",
"md5": "2a3509d02b632af9c00318885c40f773",
"sha256": "a46da5b54706076f6bd1313c2af974322081b17a9c0649f827cee711c1d5578a"
},
"downloads": -1,
"filename": "tree_disk_segmentation-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "2a3509d02b632af9c00318885c40f773",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 5894,
"upload_time": "2025-02-25T18:40:36",
"upload_time_iso_8601": "2025-02-25T18:40:36.257346Z",
"url": "https://files.pythonhosted.org/packages/4e/99/f57cd6ff0c2071eaf6fb6ed716ea87e7e45b7b1b42754efc099a5553460a/tree_disk_segmentation-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-25 18:40:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tuke307",
"github_project": "tree-disk-analyzer",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tree-disk-segmentation"
}