Skip to content
Snippets Groups Projects
Commit 81c851f8 authored by François  LAURENT's avatar François LAURENT
Browse files

--class-weights argument for train (#83)

parent bb237818
Branches
Tags
No related merge requests found
Pipeline #97821 passed
......@@ -10,7 +10,7 @@ usage = """Larva Tagger.
Usage:
larvatagger.jl import <input-path> [<output-file>] [--id=<id>] [--framerate=<fps>] [--pixelsize=<μm>] [--overrides=<comma-separated-list>] [--default-label=<label>] [--manual-label=<label>] [--decode]
larvatagger.jl open <file-path> [--backends=<path>] [--port=<number>] [--quiet] [--viewer] [--browser] [--manual-label=<label>]
larvatagger.jl train <backend-path> <data-path> <model-instance> [--pretrained-model=<instance>] [--labels=<comma-separated-list>] [--sample-size=<N>] [--balancing-strategy=<strategy>] [--manual-label=<label>] [--layers=<N>] [--iterations=<N>]
larvatagger.jl train <backend-path> <data-path> <model-instance> [--pretrained-model=<instance>] [--labels=<comma-separated-list>] [--sample-size=<N>] [--balancing-strategy=<strategy>] [--class-weights=<csv>] [--manual-label=<label>] [--layers=<N>] [--iterations=<N>]
larvatagger.jl predict <backend-path> <model-instance> <data-path> [--make-dataset] [--skip-make-dataset] [--data-isolation]
larvatagger.jl merge <input-path> <input-file> [<output-file>] [--manual-label=<label>] [--decode]
larvatagger.jl -V | --version
......@@ -37,6 +37,7 @@ Options:
--default-label=<label> Label all untagged data as <label>.
--manual-label=<label> Secondary label for manually labelled data [default: edited].
--labels=<comma-separated-list> Comma-separated list of behavior tags/labels.
--class-weights=<csv> Comma-separated list of floats.
--pretrained-model=<instance> Name of the pretrained encoder (from `pretrained_models` registry).
--balancing-strategy=<strategy> Any of `auto`, `maggotuba`, `none` [default: auto].
--overrides=<comma-separated-list> Comma-separated list of key:value pairs.
......@@ -72,6 +73,8 @@ Commands:
train Train a tagger.
<data-path> can be a path to a file or directory.
--class-weights requires --labels to be defined and the specified comma-separated values
should match those given by --labels.
predict Automatically label tracking data.
......@@ -294,6 +297,8 @@ function main(args=ARGS; exit_on_error=true)
isnothing(layers) || (kwargs[:layers] = layers)
iterations = parsed_args["--iterations"]
isnothing(iterations) || (kwargs[:iterations] = iterations)
classweights = parsed_args["--class-weights"]
isnothing(classweights) || (kwargs[:class_weights] = classweights)
train(tagger;
pretrained_instance=parsed_args["--pretrained-model"],
labels=parsed_args["--labels"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment