batdetect2/docs/source/how_to/data/define-target-classes.md
mbsantiago 67aee0b79c
Some checks failed
CI / Checks (push) Has been cancelled
Docs Pages / Build Docs (push) Has been cancelled
CI / Tests (Python ${{ matrix.python-version }}) (3.10) (push) Has been cancelled
CI / Tests (Python ${{ matrix.python-version }}) (3.11) (push) Has been cancelled
CI / Tests (Python ${{ matrix.python-version }}) (3.12) (push) Has been cancelled
Docs Pages / Deploy Docs (push) Has been cancelled
Update structure
2026-06-02 13:42:05 +01:00

62 lines
1.3 KiB
Markdown

# How to define target classes
Use this guide to map annotations to classification labels used during training.
## 1) Add classification target entries
Each entry defines a class name and matching tags.
```yaml
classification_targets:
- name: pippip
tags:
- key: class
value: Pipistrellus pipistrellus
- name: pippyg
tags:
- key: class
value: Pipistrellus pygmaeus
```
## 2) Use `assign_tags` to control decoded output tags
If you want prediction output tags to differ from matching tags, set
`assign_tags` explicitly.
```yaml
classification_targets:
- name: pipistrelle_group
tags:
- key: class
value: Pipistrellus pipistrellus
assign_tags:
- key: genus
value: Pipistrellus
```
## 3) Use `match_if` for complex class rules
For advanced conditions, use `match_if` instead of `tags`.
```yaml
classification_targets:
- name: long_call
match_if:
name: duration
operator: gt
seconds: 0.02
```
## 4) Confirm class names are unique
`classification_targets.name` values must be unique.
## Related pages
- Detection-target filtering:
{doc}`configure-target-definitions`
- ROI mapping:
{doc}`configure-roi-mapping`
- Targets config reference:
{doc}`../../reference/configs/data/targets-config-workflow`