-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli-reference.html
More file actions
201 lines (192 loc) · 12 KB
/
Copy pathcli-reference.html
File metadata and controls
201 lines (192 loc) · 12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SimpleDet Docs - CLI Reference</title>
<link rel="stylesheet" href="style.css" />
<script src="script.js" defer></script>
</head>
<body class="theme-aurora">
<header class="topbar">
<nav class="nav">
<a class="brand" href="index.html">SimpleDet <span>Docs</span></a>
<div class="nav-links">
<a class="nav-link" href="index.html">Home</a>
<a class="nav-link" href="cli-reference.html">CLI</a>
<a class="nav-link" href="api-reference.html">API</a>
<a class="nav-link" href="training.html">Training</a>
<a class="nav-link" href="inference.html">Inference</a>
<a class="nav-link" href="evaluation.html">Evaluation</a>
</div>
<div class="theme-switcher" aria-label="Theme switcher">
<button class="theme-btn" data-theme="theme-aurora">Aurora</button>
<button class="theme-btn" data-theme="theme-midnight">Midnight</button>
<button class="theme-btn" data-theme="theme-volcano">Volcano</button>
</div>
</nav>
</header>
<main class="main">
<section class="hero">
<p class="hero-kicker">SimpleDet Docs</p>
<h1>CLI reference</h1>
<p class="subtle">SimpleDet installs one console script and several public Python workflow callables.</p>
<div class="btn-row">
<a class="btn" href="overview.html">Overview</a>
<a class="btn" href="quickstart.html">Quickstart</a>
<a class="btn" href="core-concepts.html">Core Concepts</a>
<a class="btn" href="api-reference.html">API Reference</a>
</div>
<p class="hero-context">Use this page to see which entry points are real shell commands and which ones are Python callables only.</p>
</section>
<section class="content">
<article class="section">
<h2>Installed console script</h2>
<div class="table-wrap">
<table>
<thead><tr><th>Command</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>simpledet --version</code></td><td>Print the installed package version</td></tr>
<tr><td><code>python -m simpledet --check-runtime</code></td><td>Verify the optional runtime stack used by the package</td></tr>
<tr><td><code>python -m simpledet list-detectors</code></td><td>List supported high-level detector architectures</td></tr>
<tr><td><code>python -m simpledet list-heads</code></td><td>List supported detection heads and aliases</td></tr>
<tr><td><code>python -m simpledet list-backbones</code></td><td>List supported backbone aliases</td></tr>
<tr><td><code>python -m simpledet list-necks</code></td><td>List supported native necks</td></tr>
<tr><td><code>python -m simpledet list-datasets</code></td><td>List supported dataset format adapters</td></tr>
<tr><td><code>python -m simpledet doctor</code></td><td>Report Python, package, optional extra, dependency, and workdir status</td></tr>
<tr><td><code>python -m simpledet --list-encoders</code></td><td>Backward-compatible alias for backbone discovery</td></tr>
<tr><td><code>python -m simpledet --show-detector-help retinanet</code></td><td>Explain one detector family and recommended encoders</td></tr>
<tr><td><code>python -m simpledet --init-project project.toml</code></td><td>Write a starter project config</td></tr>
<tr><td><code>python -m simpledet --project-validate path/to/project.toml</code></td><td>Validate a project config without running training</td></tr>
<tr><td><code>python -m simpledet --project-run path/to/project.toml --stages build train</code></td><td>Run selected stages from a project config and write <code>run-manifest.json</code></td></tr>
<tr><td><code>python -m simpledet --train-root /data/project ...</code></td><td>Run training directly from CLI arguments</td></tr>
<tr><td><code>python -m simpledet --infer-root /data/project ...</code></td><td>Run inference directly from CLI arguments</td></tr>
<tr><td><code>python -m simpledet --eval-root /data/project ...</code></td><td>Run evaluation directly from CLI arguments</td></tr>
</tbody>
</table>
</div>
</article>
<article class="section">
<h2>Discovery commands</h2>
<p>Use these before direct execution if you do not want to guess supported architecture, component, or dataset names.</p>
<pre><code>python -m simpledet list-detectors
python -m simpledet list-heads --kind dense
python -m simpledet list-backbones --pattern resnet
python -m simpledet list-necks
python -m simpledet list-datasets
python -m simpledet doctor
python -m simpledet doctor --strict --workdir /data/project/runs
python -m simpledet --show-detector-help retinanet</code></pre>
<p><code>--list-detectors</code> prints <code>name</code>, <code>family</code>, and <code>native_validation</code> columns, so entries such as <code>cascade_rcnn</code> and <code>grid_rcnn</code> show <code>runtime_validated</code> when the native runtime extra is available. <code>simpledet list-detectors</code> is equivalent to the flag form.</p>
<p><code>list-heads</code>, <code>list-backbones</code>, <code>list-necks</code>, and <code>list-datasets</code> print <code>name</code>, <code>kind</code>, <code>validation_status</code>, and <code>required_extra</code>. These commands are safe in a base install; for example TIMM-backed backbone rows still print and show <code>timm</code> in <code>required_extra</code> instead of importing TIMM.</p>
<p><code>doctor</code> prints the Python version, SimpleDet version, optional extra status, individual dependency availability, install hints, and whether the selected workdir is writable. Missing optional extras are warnings by default; add <code>--strict</code> when setup diagnostics should return non-zero. Use <code>--check-runtime</code> when you specifically want the older CPU runtime-only gate.</p>
<p><code>--show-detector-help</code> prints the detector family, a short summary, and a few encoder suggestions for the selected architecture.</p>
</article>
<article class="section">
<h2>Direct non-config workflow</h2>
<p>Use these commands when your dataset follows the standard project layout and you want native execution without creating a project file.</p>
<pre><code>python -m simpledet --train-root /data/project \
--categories car building ship \
--in-channels 3 \
--detector retinanet \
--encoder resnet18.a1_in1k \
--batch-size 2 \
--max-epochs 30
python -m simpledet --infer-root /data/project \
--categories car building ship \
--in-channels 3 \
--detector retinanet \
--encoder resnet18.a1_in1k
python -m simpledet --eval-root /data/project \
--categories car building ship \
--in-channels 3 \
--detector retinanet \
--encoder resnet18.a1_in1k</code></pre>
<p>Direct execution currently requires <code>--categories</code>, <code>--in-channels</code>, and a high-level detector selection.</p>
<pre><code>python -m simpledet --train-root /data/project \
--categories car building ship \
--in-channels 3 \
--detector retinanet \
--encoder resnet18.a1_in1k \
--batch-size 2 \
--max-epochs 30</code></pre>
<p>Use one of these model-definition paths:</p>
<ul>
<li><code>--detector</code> with optional <code>--encoder</code> and <code>--num-classes</code> for suite-backed high-level model selection</li>
</ul>
<p>Direct CLI execution uses the native Lightning backend automatically when you use one of the supported architectures, for example <code>--detector retinanet</code>, <code>--detector vfnet</code>, <code>--detector centernet</code>, or <code>--detector faster_rcnn</code>.</p>
<p>Optional runtime flags include <code>--tif-channels-to-load</code>, <code>--result-folder</code>, <code>--resize</code>, <code>--batch-size</code>, <code>--max-epochs</code>, <code>--learning-rate</code>, and <code>--no-validate</code>.</p>
</article>
<article class="section">
<h2>Project config workflow</h2>
<p>Use a JSON or TOML file when you want a repeatable operational entrypoint for the native runtime.</p>
<pre><code>python -m simpledet --init-project project.toml
python -m simpledet --project-validate project.toml
python -m simpledet --project-run project.toml
python -m simpledet --project-run project.toml --stages build train test</code></pre>
<p>A reusable example can be created with <code>--init-project</code> and then adjusted for your dataset root and output folder. When <code>--stages</code> is omitted, the runner uses the <code>stages</code> list from the config file, or <code>build train test</code> when the file does not set one.</p>
<pre><code>stages = ["build", "train", "test"]
workdir = "/tmp/simpledet-runs"
seed = 71
[detector]
name = "retinanet"
num_classes = 1
backbone = "resnet18"
pretrained = false
[dataset]
format = "coco"
root = "/data/project"
train = "Annotations/train_annotations.json"
val = "Annotations/val_annotations.json"
test = "Annotations/test_annotations.json"
data_prefix = "imgs/"
classes = ["wake"]
in_channels = 3
[runtime]
batch_size = 2
max_epochs = 12
[optimizer]
name = "AdamW"
learning_rate = 0.001
[scheduler]
name = "step"
step_size = 2
gamma = 0.5
[checkpoint]
path = "/tmp/simpledet-runs/checkpoints/last.ckpt"
[export]
formats = ["json"]</code></pre>
<p>The runner validates the dataset root, image directory, and train/validation/test annotation files before it creates the workdir or enters training. Successful project runs write <code>run-manifest.json</code> in the workdir with the normalized detector, dataset, optimizer, scheduler, runtime, checkpoint, export, selected stages, and child native results.</p>
</article>
<article class="section">
<h2><code>simpledet.train</code></h2>
<p>Public Python callable, not a shell executable.</p>
<pre><code>train(*, config=None, pipeline=None, build=True, **pipeline_kwargs)</code></pre>
<ul>
<li><code>config=...</code> uses the lightweight <code>torchvision</code> path</li>
<li>Forwarded runtime kwargs map to the native execution helpers</li>
<li><code>detector_spec=...</code> is the supported high-level model input</li>
</ul>
</article>
<article class="section">
<h2><code>simpledet.detect</code></h2>
<pre><code>detect(*, pipeline=None, build=True, **pipeline_kwargs)</code></pre>
<p>Runs the package inference helper for the current native runtime. This is separate from <code>load_model()</code> plus <code>predict()</code>.</p>
</article>
<article class="section">
<h2><code>simpledet.evaluate</code></h2>
<pre><code>evaluate(*, pipeline=None, build=True, **pipeline_kwargs)</code></pre>
<p>Currently a thin wrapper around the same native evaluation path used by <code>run_evaluation(...)</code>.</p>
</article>
<article class="section">
<h2>Lightweight inference helpers</h2>
<pre><code>load_checkpoint_for_inference(checkpoint, *, device="cpu", model_name=None, num_classes=None, class_names=None, score_threshold=0.05, max_detections=None)
predict_image(model, image_path, *, class_names=None, device="cpu", score_threshold=None, max_detections=None, metadata=None)
predict_batch(model, image_paths, *, class_names=None, device="cpu", score_threshold=None, max_detections=None, metadata=None)
export_predictions(predictions, output_path=None, *, indent=2)</code></pre>
</article>
</section>
</main>
<footer>SimpleDet documentation · CLI reference</footer>
</body>
</html>