Fix train issues

This commit is contained in:
mbsantiago 2025-06-26 16:16:29 -06:00
parent 587742b41e
commit a0622aa9a4
3 changed files with 9 additions and 16 deletions

View File

@ -93,7 +93,7 @@ clean: clean-build clean-pyc clean-test clean-docs
# Examples # Examples
# Preprocess example data. # Preprocess example data.
example-preprocess OPTIONS: example-preprocess OPTIONS="":
batdetect2 preprocess \ batdetect2 preprocess \
--base-dir . \ --base-dir . \
--dataset-field datasets.train \ --dataset-field datasets.train \
@ -102,16 +102,9 @@ example-preprocess OPTIONS:
example_data/datasets.yaml example_data/preprocessed example_data/datasets.yaml example_data/preprocessed
# Train on example data. # Train on example data.
example-train: example-train OPTIONS="":
batdetect2 train \ batdetect2 train \
--train-examples example_data/preprocessed \ --val-dir example_data/preprocessed \
--train-config config.yaml \ --config example_data/config.yaml \
--train-config-field train \ {{OPTIONS}} \
--preprocess-config config.yaml \ example_data/preprocessed
--preprocess-config-field preprocessing \
--target-config config.yaml \
--target-config-field targets \
--postprocess-config config.yaml \
--postprocess-config-field postprocessing \
--model-config config.yaml \
--model-config-field model

View File

@ -2,13 +2,13 @@ from batdetect2.cli.base import cli
from batdetect2.cli.compat import detect from batdetect2.cli.compat import detect
from batdetect2.cli.data import data from batdetect2.cli.data import data
from batdetect2.cli.preprocess import preprocess from batdetect2.cli.preprocess import preprocess
from batdetect2.cli.train import train_detector from batdetect2.cli.train import train_command
__all__ = [ __all__ = [
"cli", "cli",
"detect", "detect",
"data", "data",
"train_detector", "train_command",
"preprocess", "preprocess",
] ]

View File

@ -18,7 +18,7 @@ __all__ = [
@cli.command(name="train") @cli.command(name="train")
@click.option("--train-dir", type=click.Path(exists=True), required=True) @click.argument("train_dir", type=click.Path(exists=True))
@click.option("--val-dir", type=click.Path(exists=True)) @click.option("--val-dir", type=click.Path(exists=True))
@click.option("--model-path", type=click.Path(exists=True)) @click.option("--model-path", type=click.Path(exists=True))
@click.option("--config", type=click.Path(exists=True)) @click.option("--config", type=click.Path(exists=True))