curu-caption 3.0.3__tar.gz → 3.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {curu_caption-3.0.3 → curu_caption-3.1.0}/Cargo.lock +3 -3
- {curu_caption-3.0.3 → curu_caption-3.1.0}/Cargo.toml +1 -1
- {curu_caption-3.0.3 → curu_caption-3.1.0}/PKG-INFO +98 -30
- {curu_caption-3.0.3 → curu_caption-3.1.0}/README.md +94 -23
- {curu_caption-3.0.3 → curu_caption-3.1.0}/pyproject.toml +18 -18
- curu_caption-3.1.0/src/curu_caption/adapters/_vision_media.py +46 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/adapters/embeddinggemma.py +18 -2
- curu_caption-3.1.0/src/curu_caption/adapters/vision_service.py +237 -0
- curu_caption-3.1.0/src/curu_caption/adapters/vlm_captioner.py +471 -0
- curu_caption-3.1.0/src/curu_caption/adapters/vlm_judge.py +148 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/adapters/wd14_tagger.py +52 -7
- curu_caption-3.1.0/src/curu_caption/audio_models.py +346 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/caption_grounding.py +28 -10
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/commands/corpus_cli.py +53 -35
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/commands/media.py +2 -1
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/config.py +30 -1
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/audio_extractors.py +13 -23
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/cheap_extractors.py +44 -26
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/claim_check.py +110 -21
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/extractors.py +28 -17
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/motion.py +4 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/music.py +18 -9
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/sound_fusion.py +8 -1
- curu_caption-3.1.0/src/curu_caption/quality.py +152 -0
- curu_caption-3.0.3/src/curu_caption/adapters/_vision_media.py +0 -97
- curu_caption-3.0.3/src/curu_caption/adapters/vlm_captioner.py +0 -437
- curu_caption-3.0.3/src/curu_caption/adapters/vlm_judge.py +0 -174
- curu_caption-3.0.3/src/curu_caption/audio_models.py +0 -344
- curu_caption-3.0.3/src/curu_caption/ollama_provider.py +0 -268
- curu_caption-3.0.3/src/curu_caption/quality.py +0 -130
- {curu_caption-3.0.3 → curu_caption-3.1.0}/LICENSE +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/Cargo.toml +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/assets/SEETAFACE_MODEL_LICENSE +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/assets/seeta_fd_frontal_v1.0.bin +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/benches/filter_1080p.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/benches/frame_extraction.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/benches/similarity.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/aesthetic.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/ahash.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/atomic_write.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/backpressure.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/blur_type.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/clip.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/decode.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/embed.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/error.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/face.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/filter.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/histogram.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/lib.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/phash.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/quality.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/shard_layout.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/sharpness.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/shot.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-core/src/sobel.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-ondisk/Cargo.toml +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-ondisk/src/atomic_write.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-ondisk/src/facts.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-ondisk/src/lib.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/crates/curu-ondisk/src/png_meta.rs +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/__init__.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/__main__.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/_core.pyi +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/_tui_launcher.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/adapters/__init__.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/adapters/combined_captioner.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/aitk/__init__.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/aitk/emitter.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/batch.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/cli.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/comfy/__init__.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/comfy/infer.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/comfy/workflow.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/commands/__init__.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/commands/comfy.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/content_version.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/__init__.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/avdm_adapter.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/bundle.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/bundle_review.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/conform.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/cull.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/cut.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/derive.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/encode.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/enrich.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/origin.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/probe.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/projection.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/provenance.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/review_page.html +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/role.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/select.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/shot_frames.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/speech.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/store.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/trainer_config.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/trainers.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/corpus/window.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/curation/__init__.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/curation/dedup.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/curation/judge.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/facts.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/infra.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/local_staging_sync.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/media_extensions.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/meta.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/models.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/ort_providers.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/pipeline.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/ports/__init__.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/ports/captioning.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/ports/judging.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/ports/tagging.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/progress_report.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/shard_layout.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/sidecar.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/staged_processing.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/video/__init__.py +0 -0
- {curu_caption-3.0.3 → curu_caption-3.1.0}/src/curu_caption/video/midpoint_frame.py +0 -0
|
@@ -495,7 +495,7 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
|
|
|
495
495
|
|
|
496
496
|
[[package]]
|
|
497
497
|
name = "curu-core"
|
|
498
|
-
version = "3.0
|
|
498
|
+
version = "3.1.0"
|
|
499
499
|
dependencies = [
|
|
500
500
|
"anyhow",
|
|
501
501
|
"crc32fast",
|
|
@@ -519,7 +519,7 @@ dependencies = [
|
|
|
519
519
|
|
|
520
520
|
[[package]]
|
|
521
521
|
name = "curu-ondisk"
|
|
522
|
-
version = "3.0
|
|
522
|
+
version = "3.1.0"
|
|
523
523
|
dependencies = [
|
|
524
524
|
"anyhow",
|
|
525
525
|
"crc32fast",
|
|
@@ -532,7 +532,7 @@ dependencies = [
|
|
|
532
532
|
|
|
533
533
|
[[package]]
|
|
534
534
|
name = "curu-tui"
|
|
535
|
-
version = "3.0
|
|
535
|
+
version = "3.1.0"
|
|
536
536
|
dependencies = [
|
|
537
537
|
"anyhow",
|
|
538
538
|
"clap",
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: curu-caption
|
|
3
|
-
Version: 3.0
|
|
4
|
-
Requires-Dist: avdm>=0.
|
|
5
|
-
Requires-Dist: curu-vision>=0.
|
|
3
|
+
Version: 3.1.0
|
|
4
|
+
Requires-Dist: avdm>=0.3.1,<0.4
|
|
5
|
+
Requires-Dist: curu-vision[gpu]>=0.23.0,<0.24
|
|
6
6
|
Requires-Dist: av>=17
|
|
7
7
|
Requires-Dist: click>=8
|
|
8
8
|
Requires-Dist: curu-infra>=0.66,<0.73
|
|
9
9
|
Requires-Dist: httpx>=0.27
|
|
10
|
-
Requires-Dist: huggingface-hub>=1.0
|
|
11
10
|
Requires-Dist: mutagen>=1.48.1
|
|
12
11
|
Requires-Dist: numpy>=2.0,<2.5
|
|
13
12
|
Requires-Dist: onnxruntime>=1.31,<1.32
|
|
14
13
|
Requires-Dist: pillow>=10
|
|
15
|
-
Requires-Dist: pydantic
|
|
14
|
+
Requires-Dist: pydantic>=2
|
|
16
15
|
Requires-Dist: pypng>=0.20220715.0
|
|
17
16
|
Requires-Dist: pyyaml>=6
|
|
18
17
|
Requires-Dist: rich>=13
|
|
19
18
|
Requires-Dist: scikit-learn>=1.3
|
|
20
19
|
Requires-Dist: torch>=2.2
|
|
21
|
-
Requires-Dist: torchvision
|
|
22
|
-
Requires-Dist: transformers>=5.19
|
|
23
20
|
Requires-Dist: watchdog>=4.0
|
|
24
21
|
Requires-Dist: librosa>=0.10 ; extra == 'audio'
|
|
25
22
|
Requires-Dist: soundfile>=0.12 ; extra == 'audio'
|
|
@@ -74,9 +71,11 @@ default, and no step needs a cloud account.
|
|
|
74
71
|
|
|
75
72
|
You need Python 3.12 or later, [uv](https://docs.astral.sh/uv/), a Rust toolchain
|
|
76
73
|
([rustup](https://rustup.rs/)), [ffmpeg](https://ffmpeg.org) and [Ollama](https://ollama.com).
|
|
74
|
+
On a computer with no CUDA GPU, you also need `llama-server` from
|
|
75
|
+
[llama.cpp](https://github.com/ggml-org/llama.cpp) for the quality scores and the claim check.
|
|
77
76
|
|
|
78
77
|
To install the released package from PyPI, you need only Python 3.12 or later, uv, ffmpeg and
|
|
79
|
-
Ollama
|
|
78
|
+
Ollama. On a computer with no CUDA GPU, you also need `llama-server`:
|
|
80
79
|
|
|
81
80
|
```bash
|
|
82
81
|
uv tool install "curu-caption[audio]" # curu-caption and curu-caption-tui on the PATH
|
|
@@ -247,7 +246,7 @@ second run of `index` prints:
|
|
|
247
246
|
```text
|
|
248
247
|
index 7 kept item(s) in photo-corpus (4 culled, excluded or detection-only, not indexed)
|
|
249
248
|
indexing with EmbeddingGemma 2 (curu-vision)
|
|
250
|
-
judging quality with
|
|
249
|
+
judging quality with d1-3B (curu_vision.questions, gguf engine) — a review pre-sort, never a gate
|
|
251
250
|
embedding: 0 extracted, 7 already current
|
|
252
251
|
quality: 0 extracted, 7 already current
|
|
253
252
|
|
|
@@ -257,8 +256,8 @@ index ready — photo-corpus
|
|
|
257
256
|
`index` reads only the kept items. It does not make a fact again when the fact is current for
|
|
258
257
|
its model and parameters. Thus a second run does nothing, as in the example output.
|
|
259
258
|
|
|
260
|
-
Run `index` again on each corpus after a change to the index model. The embedding fact records the model
|
|
261
|
-
the version of curu-vision. After you update curu-vision, each vector is stale. `cut --want` does
|
|
259
|
+
Run `index` again on each corpus after a change to the index model. The embedding fact records the model,
|
|
260
|
+
its engine and the version of curu-vision. After you update curu-vision, each vector is stale. `cut --want` does
|
|
262
261
|
not use a stale vector, and `index` makes it again. curu-vision puts each transparent part of a
|
|
263
262
|
picture onto white before the embedding.
|
|
264
263
|
|
|
@@ -294,10 +293,17 @@ rating of live-action footage is not accurate.
|
|
|
294
293
|
| Step | On a CUDA GPU | On a CPU or Apple silicon |
|
|
295
294
|
|---|---|---|
|
|
296
295
|
| Index (EmbeddingGemma 2) | not measured; it needs the `gpu` extra | about 5.4 s for each 1280x720 frame (Apple M1 CPU) |
|
|
297
|
-
| Quality (d1-3B) | about 0.25 s for each item (RTX 3090) | about
|
|
296
|
+
| Quality (d1-3B) | about 0.25 s for each item (RTX 3090) | about 20 s for each item of three 1280x720 frames (16 GB Apple M1, `gguf` engine, with other work running) |
|
|
298
297
|
| WD14 tags and rating (`--tags`) | — | about 4.5 s for each item (the `--tags` help) |
|
|
299
298
|
|
|
300
|
-
|
|
299
|
+
d1-3B runs in curu-vision, which has two engines for it. An engine is the software that runs
|
|
300
|
+
the model. With a CUDA GPU, curu-vision uses the `transformers` engine. Else it uses the `gguf`
|
|
301
|
+
engine, which needs `llama-server` from llama.cpp on the `PATH`. Install it, for example with
|
|
302
|
+
`brew install llama.cpp`. The `llama-server` build must have the `/v1/systemone` endpoint. The
|
|
303
|
+
tests of curu-vision used build 11960. The two engines give almost the same numbers, and each
|
|
304
|
+
fact records its engine.
|
|
305
|
+
|
|
306
|
+
On a Mac, to save time, use `--no-quality`. Then run `index` later on a computer with a GPU.
|
|
301
307
|
|
|
302
308
|
## Find items by meaning
|
|
303
309
|
|
|
@@ -354,7 +360,9 @@ train. The default is `ltx`.
|
|
|
354
360
|
| `h3-prose` | Prose of the picture and the motion, with no audio | as `h3` |
|
|
355
361
|
|
|
356
362
|
- **Captions.** The caption model fills in a fixed form of claims about the middle frame of the
|
|
357
|
-
item.
|
|
363
|
+
item. The form lists up to 8 things. Each thing has a kind: a person, a character, an animal, a
|
|
364
|
+
vehicle, a structure, an object or a group. Each thing also has a depiction, for example live
|
|
365
|
+
or on a screen. Then d1-3B checks each claim with a yes or no question. The caption keeps only the
|
|
358
366
|
checked claims, one plain sentence for each.
|
|
359
367
|
- **Missing facts.** `--dry-run` names each fact that the projection needs and the corpus does
|
|
360
368
|
not have. `ltx` needs a `sound` fact, and `h3` uses one when it has it. `--caption` makes it
|
|
@@ -543,6 +551,10 @@ Judged 4 image(s): 3 keep, 1 reject.
|
|
|
543
551
|
Each line gives the verdict and the reason of the model. If the model rejects all the images,
|
|
544
552
|
`judge` changes each verdict to keep and says so. Then the criteria are too strict or not
|
|
545
553
|
clear.
|
|
554
|
+
|
|
555
|
+
`judge` sends a temperature of 0.1 with each request. `caption` sends the same value. The temperature controls how
|
|
556
|
+
much the answers of the model change from one run to the next. A lower value gives answers that
|
|
557
|
+
change less, but 0.1 does not make a verdict fixed.
|
|
546
558
|
## Write dataset.yaml for a folder
|
|
547
559
|
|
|
548
560
|
`dataset-config` writes the `dataset.yaml` that AI-Toolkit trains from, for a folder of media
|
|
@@ -654,6 +666,19 @@ model = "saracen9/amoral-qwen3.8-27b"
|
|
|
654
666
|
providers = "cpu"
|
|
655
667
|
```
|
|
656
668
|
|
|
669
|
+
To run EmbeddingGemma 2 and the WD14 tagger on curu-vision's model service, set its URL and
|
|
670
|
+
its token. A model service is a curu-vision process on another computer:
|
|
671
|
+
|
|
672
|
+
```bash
|
|
673
|
+
export CURU_VISION_URL=http://gpu-box:8765
|
|
674
|
+
export CURU_VISION_TOKEN=...
|
|
675
|
+
curu-caption index --corpus photo-corpus/ --tags
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
There is no fallback. If the service does not answer, `index`, `cut --want` and
|
|
679
|
+
`caption --tags` stop with an error, and `ingest` makes the corpus with no index. Each fact
|
|
680
|
+
records the engine that made it, so a fact from the service is stale for a run without it.
|
|
681
|
+
|
|
657
682
|
Each setting, environment variable and file on disk is in
|
|
658
683
|
[docs/configuration.md](docs/configuration.md).
|
|
659
684
|
|
|
@@ -703,7 +728,8 @@ exit code 1
|
|
|
703
728
|
- **The picture is checked, not proven.** On 40 test frames, 88 of the 898 claims that the check
|
|
704
729
|
kept were false (precision 0.90, against 0.81 for the old prose captions). Most errors are
|
|
705
730
|
upper garments, the direction that a person faces, and headwear. The check of helmets is poor,
|
|
706
|
-
and an invented person keeps its claims.
|
|
731
|
+
and an invented person keeps its claims. That measurement is of persons only. The check of the
|
|
732
|
+
other kinds, of the depiction and of the new `space helmet` value of headwear has no measurement yet.
|
|
707
733
|
- **`--provider openrouter` ignores the corpus prompts.** It does not get the claims form or the
|
|
708
734
|
motion and sound prompts. Use Ollama for the captions of a cut. `cut --caption` has no cloud
|
|
709
735
|
provider.
|
|
@@ -713,14 +739,21 @@ exit code 1
|
|
|
713
739
|
- **`review` does not sort by quality**, because it cannot read the facts of a clip yet
|
|
714
740
|
([#87](https://github.com/darth-veitcher/curu-caption/issues/87)).
|
|
715
741
|
- **`review` has no mouse** ([#101](https://github.com/darth-veitcher/curu-caption/issues/101)).
|
|
716
|
-
- **d1-3B is slow without CUDA.** On a Mac, the quality scores and the claim check run
|
|
717
|
-
|
|
742
|
+
- **d1-3B is slow without CUDA.** On a Mac, the quality scores and the claim check run in
|
|
743
|
+
`llama-server`. On a 16 GB Apple M1, the quality scores take about 20 s for each item. A
|
|
744
|
+
claim check of 101 questions about one frame takes about 3 minutes. On CUDA, each takes less
|
|
745
|
+
than a second.
|
|
746
|
+
- **The claim check was measured on CUDA.** A P(yes) is the probability that the answer is
|
|
747
|
+
yes. The cut leaves out a claim when d1-3B gives a different value a P(yes) more than 0.2
|
|
748
|
+
higher ([Know how a caption is made](docs/cut.md#know-how-a-caption-is-made)). That limit comes
|
|
749
|
+
from the `transformers` engine. The `gguf` engine gives slightly different numbers. There is
|
|
750
|
+
no measurement of the limit on that engine yet.
|
|
718
751
|
- **It does not train.** curu-caption makes datasets. AI-Toolkit trains.
|
|
719
752
|
|
|
720
753
|
## Technical notes
|
|
721
754
|
|
|
722
755
|
- **Licence.** MIT ([LICENSE](LICENSE)).
|
|
723
|
-
- **Version.** 3.0
|
|
756
|
+
- **Version.** 3.1.0, set in `pyproject.toml` (`project.version`) and in `Cargo.toml`
|
|
724
757
|
(`workspace.package.version`). The changes are in [CHANGELOG.md](CHANGELOG.md).
|
|
725
758
|
- **Build.** `uv sync` builds `crates/curu-core` into `curu_caption._core` with maturin.
|
|
726
759
|
`crates/curu-tui` is the `review` program, and `crates/curu-ondisk` writes PNG text chunks.
|
|
@@ -728,18 +761,42 @@ exit code 1
|
|
|
728
761
|
`[tool.uv] cache-keys` in `pyproject.toml` lists the files that cause a new build. On Linux,
|
|
729
762
|
the extension contains its own copy of liblzma, a compression library, so it needs no system
|
|
730
763
|
copy.
|
|
731
|
-
- **Platforms.** macOS and Linux. On Apple silicon,
|
|
732
|
-
5.6 times slower for WD14.
|
|
764
|
+
- **Platforms.** macOS and Linux. On Apple silicon, WD14, EmbeddingGemma 2 and the audio models
|
|
765
|
+
run on the CPU, because CoreML was 1.6 to 5.6 times slower for WD14. d1-3B runs in
|
|
766
|
+
`llama-server`, on the GPU through Metal.
|
|
733
767
|
- **ffmpeg.** On x86_64, the Rust core downloads ffmpeg when it is not on the `PATH`. On other
|
|
734
768
|
platforms, install it.
|
|
735
769
|
- **Models.** Each model downloads on first use, at a pinned revision. EmbeddingGemma 2 (1.8 GB)
|
|
736
|
-
is the index, and d1-3B
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
770
|
+
is the index, and d1-3B gives the quality scores and the claim check. d1-3B is 6.3 GB for the
|
|
771
|
+
`transformers` engine and 3.5 GB for the `gguf` engine. WD14 (455 MB) gives the tags and the
|
|
772
|
+
rating. These models and the audio models come from curu-vision, which checks the SHA-256 of each file.
|
|
773
|
+
The tagger is `wd-v1-4-swinv2-tagger-v2` by name, because curu-vision 0.16 made another tagger
|
|
774
|
+
its default. With `CURU_VISION_URL`, EmbeddingGemma 2 and WD14 run on the model service. Then
|
|
775
|
+
this computer downloads no weights for these two models, only the tagger's list of tags.
|
|
776
|
+
The caption model comes from Ollama or OpenRouter.
|
|
777
|
+
- **d1-3B facts.** A `quality` or `claim_check` fact records the version of curu-vision and the
|
|
778
|
+
engine. A `quality` fact also records a fingerprint of each question. A `claim_check` fact
|
|
779
|
+
records one fingerprint of all its questions and how it asks them. Each curu-vision release
|
|
780
|
+
pins the revision of each engine. After an update of curu-vision, the facts are stale, and
|
|
781
|
+
`index` or `cut --caption` makes them again.
|
|
782
|
+
- **Two engines.** A `claim_check` fact from one engine is stale for the other engine, and
|
|
783
|
+
`cut --caption` makes it again. `ingest` and `index` make the `quality` fact again for the
|
|
784
|
+
engine of the computer. Until then, `cut` uses the quality scores of the other engine,
|
|
785
|
+
because they only sort `review`.
|
|
786
|
+
- **Caption model calls.** Each request to Ollama or OpenRouter goes through the VLM interface
|
|
787
|
+
of curu-vision (its `vlm` module). curu-vision limits the size of each picture before it sends it. The
|
|
788
|
+
longer side is at most 1,024 px, or 448 px for the frames of a motion description. The `visual`,
|
|
789
|
+
`motion` and `sound` facts record the version of this step. When it changes, the facts are
|
|
790
|
+
stale. `cut --caption` makes them again for the items of that cut.
|
|
791
|
+
- **Audio models.** All the audio models come from curu-vision, and download into its cache.
|
|
792
|
+
The sound captioner (968 MB) writes the sound labels. AST (346 MB) is an audio tagger that
|
|
793
|
+
gives a score from 0 to 1 for each AudioSet sound label. Speech comes from MOSS (1.8 GB) on a
|
|
794
|
+
computer with CUDA, which labels speakers, and Parakeet (2.4 GB) on other computers.
|
|
795
|
+
- **Sound facts.** The `sound_labels` and `music` facts record the version of curu-vision. After an
|
|
796
|
+
update of curu-vision, the facts are stale, and `cut --caption` makes them again.
|
|
797
|
+
- **Silent audio.** curu-vision does not give digital silence to the sound captioner or AST.
|
|
798
|
+
Digital silence is audio in which each 100 ms part is below -70 dBFS. When all the audio of an
|
|
799
|
+
item is digital silence, the `sound_labels` fact is empty, and the caption shows `N/A` for the music.
|
|
743
800
|
- **Tutorials.** The records of real training runs use the commands of version 2.0, which do
|
|
744
801
|
not exist now. They are in
|
|
745
802
|
[project-management/archive/tutorials-v2/](project-management/archive/tutorials-v2/README.md).
|
|
@@ -803,8 +860,8 @@ scripts/check.sh --full # also a build from a new clone, before a release or
|
|
|
803
860
|
- **AAC**: a lossy audio format: the decoded audio is not the same as the audio before the
|
|
804
861
|
encode. An MP4 file usually holds AAC audio.
|
|
805
862
|
- **AI-Toolkit**: the trainer that reads a `dataset.yaml` or a `job.yaml` (ostris/ai-toolkit).
|
|
806
|
-
- **AST**: an audio tagger that gives a
|
|
807
|
-
fact comes from it.
|
|
863
|
+
- **AST**: an audio tagger that gives a score from 0 to 1 for each AudioSet sound label. A higher
|
|
864
|
+
score means more evidence for the label. The `music` fact comes from it.
|
|
808
865
|
- **AUROC**: the probability that a score puts a good item above a bad item. 0.5 is chance, and
|
|
809
866
|
1.0 is always correct.
|
|
810
867
|
- **AVDM**: the scene document that each caption comes from (the `avdm` package).
|
|
@@ -821,10 +878,17 @@ scripts/check.sh --full # also a build from a new clone, before a release or
|
|
|
821
878
|
- **d1-3B**: a LiquidAI model that gives the quality scores and the claim check.
|
|
822
879
|
- **dBFS**: the level of a sound sample in decibels (dB), where 0 dBFS is full scale. A lower
|
|
823
880
|
(more negative) value is quieter.
|
|
881
|
+
- **Digital silence**: audio in which each 100 ms part is below -70 dBFS. curu-vision does not
|
|
882
|
+
give it to the sound captioner or AST.
|
|
824
883
|
- **Diarization**: a step that finds who speaks when, in an audio track.
|
|
825
884
|
- **Embedding**: a list of numbers for a picture or a text. Items with a similar meaning have
|
|
826
885
|
similar embeddings.
|
|
886
|
+
- **Engine**: the software that runs a model. For d1-3B, `transformers` on a CUDA GPU, or `gguf`
|
|
887
|
+
(`llama-server`) on a CPU or Apple silicon. For EmbeddingGemma 2 and WD14, ONNX Runtime on a
|
|
888
|
+
provider, for example `onnx-cpu` or `onnx-cuda`.
|
|
827
889
|
- **Fact**: a value that a step measured or made for one item, with its provenance.
|
|
890
|
+
- **Fingerprint**: the first 16 hexadecimal digits of the SHA-256 of a text. A change to the
|
|
891
|
+
text changes the fingerprint.
|
|
828
892
|
- **FLAC**: a lossless audio format. The decoded audio is the same as the audio before the
|
|
829
893
|
encode.
|
|
830
894
|
- **Full scale**: the loudest sample value that a digital audio format can hold. The format
|
|
@@ -833,6 +897,8 @@ scripts/check.sh --full # also a build from a new clone, before a release or
|
|
|
833
897
|
- **Laplacian variance**: a measure of the detail in a picture. A blank frame is near 0.
|
|
834
898
|
- **LoRA**: a small set of extra weights that trains a model on one subject or style.
|
|
835
899
|
- **musubi-tuner**: the trainer that reads the files of `--trainer musubi` (kohya-ss/musubi-tuner).
|
|
900
|
+
- **Model service**: a curu-vision process that runs EmbeddingGemma 2 and the WD14 tagger for
|
|
901
|
+
other computers, over HTTP with a bearer token. `CURU_VISION_URL` names it.
|
|
836
902
|
- **Near-duplicate**: a frame or file that looks almost the same as another.
|
|
837
903
|
- **Ollama**: the local program that runs the caption model.
|
|
838
904
|
- **Perceptual hash (pHash)**: a 64-bit summary of how a picture looks. Similar pictures have
|
|
@@ -840,9 +906,11 @@ scripts/check.sh --full # also a build from a new clone, before a release or
|
|
|
840
906
|
- **Projection**: the form of caption and media that one model trains on.
|
|
841
907
|
- **Provenance**: the record of which producer made a fact, and with which parameters.
|
|
842
908
|
- **Staging**: work on the local disk, then one copy to the destination.
|
|
909
|
+
- **Temperature**: a setting of the model, usually from 0 to 2. A lower value makes the answers
|
|
910
|
+
change less from one run to the next.
|
|
843
911
|
- **Trigger word**: the word at the start of each caption that calls the LoRA, for example
|
|
844
912
|
`ohwx`.
|
|
845
|
-
- **VLM**: a vision-language model, here the caption model in Ollama.
|
|
913
|
+
- **VLM**: a vision-language model, here the caption model in Ollama or OpenRouter.
|
|
846
914
|
- **WD14 rating**: four scores from the WD14 tagger, `general`, `sensitive`, `questionable` and
|
|
847
915
|
`explicit`, each from 0 to 1. Each score is the probability that the picture has that content
|
|
848
916
|
rating, from `general` (safe) to `explicit`.
|
|
@@ -37,9 +37,11 @@ default, and no step needs a cloud account.
|
|
|
37
37
|
|
|
38
38
|
You need Python 3.12 or later, [uv](https://docs.astral.sh/uv/), a Rust toolchain
|
|
39
39
|
([rustup](https://rustup.rs/)), [ffmpeg](https://ffmpeg.org) and [Ollama](https://ollama.com).
|
|
40
|
+
On a computer with no CUDA GPU, you also need `llama-server` from
|
|
41
|
+
[llama.cpp](https://github.com/ggml-org/llama.cpp) for the quality scores and the claim check.
|
|
40
42
|
|
|
41
43
|
To install the released package from PyPI, you need only Python 3.12 or later, uv, ffmpeg and
|
|
42
|
-
Ollama
|
|
44
|
+
Ollama. On a computer with no CUDA GPU, you also need `llama-server`:
|
|
43
45
|
|
|
44
46
|
```bash
|
|
45
47
|
uv tool install "curu-caption[audio]" # curu-caption and curu-caption-tui on the PATH
|
|
@@ -210,7 +212,7 @@ second run of `index` prints:
|
|
|
210
212
|
```text
|
|
211
213
|
index 7 kept item(s) in photo-corpus (4 culled, excluded or detection-only, not indexed)
|
|
212
214
|
indexing with EmbeddingGemma 2 (curu-vision)
|
|
213
|
-
judging quality with
|
|
215
|
+
judging quality with d1-3B (curu_vision.questions, gguf engine) — a review pre-sort, never a gate
|
|
214
216
|
embedding: 0 extracted, 7 already current
|
|
215
217
|
quality: 0 extracted, 7 already current
|
|
216
218
|
|
|
@@ -220,8 +222,8 @@ index ready — photo-corpus
|
|
|
220
222
|
`index` reads only the kept items. It does not make a fact again when the fact is current for
|
|
221
223
|
its model and parameters. Thus a second run does nothing, as in the example output.
|
|
222
224
|
|
|
223
|
-
Run `index` again on each corpus after a change to the index model. The embedding fact records the model
|
|
224
|
-
the version of curu-vision. After you update curu-vision, each vector is stale. `cut --want` does
|
|
225
|
+
Run `index` again on each corpus after a change to the index model. The embedding fact records the model,
|
|
226
|
+
its engine and the version of curu-vision. After you update curu-vision, each vector is stale. `cut --want` does
|
|
225
227
|
not use a stale vector, and `index` makes it again. curu-vision puts each transparent part of a
|
|
226
228
|
picture onto white before the embedding.
|
|
227
229
|
|
|
@@ -257,10 +259,17 @@ rating of live-action footage is not accurate.
|
|
|
257
259
|
| Step | On a CUDA GPU | On a CPU or Apple silicon |
|
|
258
260
|
|---|---|---|
|
|
259
261
|
| Index (EmbeddingGemma 2) | not measured; it needs the `gpu` extra | about 5.4 s for each 1280x720 frame (Apple M1 CPU) |
|
|
260
|
-
| Quality (d1-3B) | about 0.25 s for each item (RTX 3090) | about
|
|
262
|
+
| Quality (d1-3B) | about 0.25 s for each item (RTX 3090) | about 20 s for each item of three 1280x720 frames (16 GB Apple M1, `gguf` engine, with other work running) |
|
|
261
263
|
| WD14 tags and rating (`--tags`) | — | about 4.5 s for each item (the `--tags` help) |
|
|
262
264
|
|
|
263
|
-
|
|
265
|
+
d1-3B runs in curu-vision, which has two engines for it. An engine is the software that runs
|
|
266
|
+
the model. With a CUDA GPU, curu-vision uses the `transformers` engine. Else it uses the `gguf`
|
|
267
|
+
engine, which needs `llama-server` from llama.cpp on the `PATH`. Install it, for example with
|
|
268
|
+
`brew install llama.cpp`. The `llama-server` build must have the `/v1/systemone` endpoint. The
|
|
269
|
+
tests of curu-vision used build 11960. The two engines give almost the same numbers, and each
|
|
270
|
+
fact records its engine.
|
|
271
|
+
|
|
272
|
+
On a Mac, to save time, use `--no-quality`. Then run `index` later on a computer with a GPU.
|
|
264
273
|
|
|
265
274
|
## Find items by meaning
|
|
266
275
|
|
|
@@ -317,7 +326,9 @@ train. The default is `ltx`.
|
|
|
317
326
|
| `h3-prose` | Prose of the picture and the motion, with no audio | as `h3` |
|
|
318
327
|
|
|
319
328
|
- **Captions.** The caption model fills in a fixed form of claims about the middle frame of the
|
|
320
|
-
item.
|
|
329
|
+
item. The form lists up to 8 things. Each thing has a kind: a person, a character, an animal, a
|
|
330
|
+
vehicle, a structure, an object or a group. Each thing also has a depiction, for example live
|
|
331
|
+
or on a screen. Then d1-3B checks each claim with a yes or no question. The caption keeps only the
|
|
321
332
|
checked claims, one plain sentence for each.
|
|
322
333
|
- **Missing facts.** `--dry-run` names each fact that the projection needs and the corpus does
|
|
323
334
|
not have. `ltx` needs a `sound` fact, and `h3` uses one when it has it. `--caption` makes it
|
|
@@ -506,6 +517,10 @@ Judged 4 image(s): 3 keep, 1 reject.
|
|
|
506
517
|
Each line gives the verdict and the reason of the model. If the model rejects all the images,
|
|
507
518
|
`judge` changes each verdict to keep and says so. Then the criteria are too strict or not
|
|
508
519
|
clear.
|
|
520
|
+
|
|
521
|
+
`judge` sends a temperature of 0.1 with each request. `caption` sends the same value. The temperature controls how
|
|
522
|
+
much the answers of the model change from one run to the next. A lower value gives answers that
|
|
523
|
+
change less, but 0.1 does not make a verdict fixed.
|
|
509
524
|
## Write dataset.yaml for a folder
|
|
510
525
|
|
|
511
526
|
`dataset-config` writes the `dataset.yaml` that AI-Toolkit trains from, for a folder of media
|
|
@@ -617,6 +632,19 @@ model = "saracen9/amoral-qwen3.8-27b"
|
|
|
617
632
|
providers = "cpu"
|
|
618
633
|
```
|
|
619
634
|
|
|
635
|
+
To run EmbeddingGemma 2 and the WD14 tagger on curu-vision's model service, set its URL and
|
|
636
|
+
its token. A model service is a curu-vision process on another computer:
|
|
637
|
+
|
|
638
|
+
```bash
|
|
639
|
+
export CURU_VISION_URL=http://gpu-box:8765
|
|
640
|
+
export CURU_VISION_TOKEN=...
|
|
641
|
+
curu-caption index --corpus photo-corpus/ --tags
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
There is no fallback. If the service does not answer, `index`, `cut --want` and
|
|
645
|
+
`caption --tags` stop with an error, and `ingest` makes the corpus with no index. Each fact
|
|
646
|
+
records the engine that made it, so a fact from the service is stale for a run without it.
|
|
647
|
+
|
|
620
648
|
Each setting, environment variable and file on disk is in
|
|
621
649
|
[docs/configuration.md](docs/configuration.md).
|
|
622
650
|
|
|
@@ -666,7 +694,8 @@ exit code 1
|
|
|
666
694
|
- **The picture is checked, not proven.** On 40 test frames, 88 of the 898 claims that the check
|
|
667
695
|
kept were false (precision 0.90, against 0.81 for the old prose captions). Most errors are
|
|
668
696
|
upper garments, the direction that a person faces, and headwear. The check of helmets is poor,
|
|
669
|
-
and an invented person keeps its claims.
|
|
697
|
+
and an invented person keeps its claims. That measurement is of persons only. The check of the
|
|
698
|
+
other kinds, of the depiction and of the new `space helmet` value of headwear has no measurement yet.
|
|
670
699
|
- **`--provider openrouter` ignores the corpus prompts.** It does not get the claims form or the
|
|
671
700
|
motion and sound prompts. Use Ollama for the captions of a cut. `cut --caption` has no cloud
|
|
672
701
|
provider.
|
|
@@ -676,14 +705,21 @@ exit code 1
|
|
|
676
705
|
- **`review` does not sort by quality**, because it cannot read the facts of a clip yet
|
|
677
706
|
([#87](https://github.com/darth-veitcher/curu-caption/issues/87)).
|
|
678
707
|
- **`review` has no mouse** ([#101](https://github.com/darth-veitcher/curu-caption/issues/101)).
|
|
679
|
-
- **d1-3B is slow without CUDA.** On a Mac, the quality scores and the claim check run
|
|
680
|
-
|
|
708
|
+
- **d1-3B is slow without CUDA.** On a Mac, the quality scores and the claim check run in
|
|
709
|
+
`llama-server`. On a 16 GB Apple M1, the quality scores take about 20 s for each item. A
|
|
710
|
+
claim check of 101 questions about one frame takes about 3 minutes. On CUDA, each takes less
|
|
711
|
+
than a second.
|
|
712
|
+
- **The claim check was measured on CUDA.** A P(yes) is the probability that the answer is
|
|
713
|
+
yes. The cut leaves out a claim when d1-3B gives a different value a P(yes) more than 0.2
|
|
714
|
+
higher ([Know how a caption is made](docs/cut.md#know-how-a-caption-is-made)). That limit comes
|
|
715
|
+
from the `transformers` engine. The `gguf` engine gives slightly different numbers. There is
|
|
716
|
+
no measurement of the limit on that engine yet.
|
|
681
717
|
- **It does not train.** curu-caption makes datasets. AI-Toolkit trains.
|
|
682
718
|
|
|
683
719
|
## Technical notes
|
|
684
720
|
|
|
685
721
|
- **Licence.** MIT ([LICENSE](LICENSE)).
|
|
686
|
-
- **Version.** 3.0
|
|
722
|
+
- **Version.** 3.1.0, set in `pyproject.toml` (`project.version`) and in `Cargo.toml`
|
|
687
723
|
(`workspace.package.version`). The changes are in [CHANGELOG.md](CHANGELOG.md).
|
|
688
724
|
- **Build.** `uv sync` builds `crates/curu-core` into `curu_caption._core` with maturin.
|
|
689
725
|
`crates/curu-tui` is the `review` program, and `crates/curu-ondisk` writes PNG text chunks.
|
|
@@ -691,18 +727,42 @@ exit code 1
|
|
|
691
727
|
`[tool.uv] cache-keys` in `pyproject.toml` lists the files that cause a new build. On Linux,
|
|
692
728
|
the extension contains its own copy of liblzma, a compression library, so it needs no system
|
|
693
729
|
copy.
|
|
694
|
-
- **Platforms.** macOS and Linux. On Apple silicon,
|
|
695
|
-
5.6 times slower for WD14.
|
|
730
|
+
- **Platforms.** macOS and Linux. On Apple silicon, WD14, EmbeddingGemma 2 and the audio models
|
|
731
|
+
run on the CPU, because CoreML was 1.6 to 5.6 times slower for WD14. d1-3B runs in
|
|
732
|
+
`llama-server`, on the GPU through Metal.
|
|
696
733
|
- **ffmpeg.** On x86_64, the Rust core downloads ffmpeg when it is not on the `PATH`. On other
|
|
697
734
|
platforms, install it.
|
|
698
735
|
- **Models.** Each model downloads on first use, at a pinned revision. EmbeddingGemma 2 (1.8 GB)
|
|
699
|
-
is the index, and d1-3B
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
736
|
+
is the index, and d1-3B gives the quality scores and the claim check. d1-3B is 6.3 GB for the
|
|
737
|
+
`transformers` engine and 3.5 GB for the `gguf` engine. WD14 (455 MB) gives the tags and the
|
|
738
|
+
rating. These models and the audio models come from curu-vision, which checks the SHA-256 of each file.
|
|
739
|
+
The tagger is `wd-v1-4-swinv2-tagger-v2` by name, because curu-vision 0.16 made another tagger
|
|
740
|
+
its default. With `CURU_VISION_URL`, EmbeddingGemma 2 and WD14 run on the model service. Then
|
|
741
|
+
this computer downloads no weights for these two models, only the tagger's list of tags.
|
|
742
|
+
The caption model comes from Ollama or OpenRouter.
|
|
743
|
+
- **d1-3B facts.** A `quality` or `claim_check` fact records the version of curu-vision and the
|
|
744
|
+
engine. A `quality` fact also records a fingerprint of each question. A `claim_check` fact
|
|
745
|
+
records one fingerprint of all its questions and how it asks them. Each curu-vision release
|
|
746
|
+
pins the revision of each engine. After an update of curu-vision, the facts are stale, and
|
|
747
|
+
`index` or `cut --caption` makes them again.
|
|
748
|
+
- **Two engines.** A `claim_check` fact from one engine is stale for the other engine, and
|
|
749
|
+
`cut --caption` makes it again. `ingest` and `index` make the `quality` fact again for the
|
|
750
|
+
engine of the computer. Until then, `cut` uses the quality scores of the other engine,
|
|
751
|
+
because they only sort `review`.
|
|
752
|
+
- **Caption model calls.** Each request to Ollama or OpenRouter goes through the VLM interface
|
|
753
|
+
of curu-vision (its `vlm` module). curu-vision limits the size of each picture before it sends it. The
|
|
754
|
+
longer side is at most 1,024 px, or 448 px for the frames of a motion description. The `visual`,
|
|
755
|
+
`motion` and `sound` facts record the version of this step. When it changes, the facts are
|
|
756
|
+
stale. `cut --caption` makes them again for the items of that cut.
|
|
757
|
+
- **Audio models.** All the audio models come from curu-vision, and download into its cache.
|
|
758
|
+
The sound captioner (968 MB) writes the sound labels. AST (346 MB) is an audio tagger that
|
|
759
|
+
gives a score from 0 to 1 for each AudioSet sound label. Speech comes from MOSS (1.8 GB) on a
|
|
760
|
+
computer with CUDA, which labels speakers, and Parakeet (2.4 GB) on other computers.
|
|
761
|
+
- **Sound facts.** The `sound_labels` and `music` facts record the version of curu-vision. After an
|
|
762
|
+
update of curu-vision, the facts are stale, and `cut --caption` makes them again.
|
|
763
|
+
- **Silent audio.** curu-vision does not give digital silence to the sound captioner or AST.
|
|
764
|
+
Digital silence is audio in which each 100 ms part is below -70 dBFS. When all the audio of an
|
|
765
|
+
item is digital silence, the `sound_labels` fact is empty, and the caption shows `N/A` for the music.
|
|
706
766
|
- **Tutorials.** The records of real training runs use the commands of version 2.0, which do
|
|
707
767
|
not exist now. They are in
|
|
708
768
|
[project-management/archive/tutorials-v2/](project-management/archive/tutorials-v2/README.md).
|
|
@@ -766,8 +826,8 @@ scripts/check.sh --full # also a build from a new clone, before a release or
|
|
|
766
826
|
- **AAC**: a lossy audio format: the decoded audio is not the same as the audio before the
|
|
767
827
|
encode. An MP4 file usually holds AAC audio.
|
|
768
828
|
- **AI-Toolkit**: the trainer that reads a `dataset.yaml` or a `job.yaml` (ostris/ai-toolkit).
|
|
769
|
-
- **AST**: an audio tagger that gives a
|
|
770
|
-
fact comes from it.
|
|
829
|
+
- **AST**: an audio tagger that gives a score from 0 to 1 for each AudioSet sound label. A higher
|
|
830
|
+
score means more evidence for the label. The `music` fact comes from it.
|
|
771
831
|
- **AUROC**: the probability that a score puts a good item above a bad item. 0.5 is chance, and
|
|
772
832
|
1.0 is always correct.
|
|
773
833
|
- **AVDM**: the scene document that each caption comes from (the `avdm` package).
|
|
@@ -784,10 +844,17 @@ scripts/check.sh --full # also a build from a new clone, before a release or
|
|
|
784
844
|
- **d1-3B**: a LiquidAI model that gives the quality scores and the claim check.
|
|
785
845
|
- **dBFS**: the level of a sound sample in decibels (dB), where 0 dBFS is full scale. A lower
|
|
786
846
|
(more negative) value is quieter.
|
|
847
|
+
- **Digital silence**: audio in which each 100 ms part is below -70 dBFS. curu-vision does not
|
|
848
|
+
give it to the sound captioner or AST.
|
|
787
849
|
- **Diarization**: a step that finds who speaks when, in an audio track.
|
|
788
850
|
- **Embedding**: a list of numbers for a picture or a text. Items with a similar meaning have
|
|
789
851
|
similar embeddings.
|
|
852
|
+
- **Engine**: the software that runs a model. For d1-3B, `transformers` on a CUDA GPU, or `gguf`
|
|
853
|
+
(`llama-server`) on a CPU or Apple silicon. For EmbeddingGemma 2 and WD14, ONNX Runtime on a
|
|
854
|
+
provider, for example `onnx-cpu` or `onnx-cuda`.
|
|
790
855
|
- **Fact**: a value that a step measured or made for one item, with its provenance.
|
|
856
|
+
- **Fingerprint**: the first 16 hexadecimal digits of the SHA-256 of a text. A change to the
|
|
857
|
+
text changes the fingerprint.
|
|
791
858
|
- **FLAC**: a lossless audio format. The decoded audio is the same as the audio before the
|
|
792
859
|
encode.
|
|
793
860
|
- **Full scale**: the loudest sample value that a digital audio format can hold. The format
|
|
@@ -796,6 +863,8 @@ scripts/check.sh --full # also a build from a new clone, before a release or
|
|
|
796
863
|
- **Laplacian variance**: a measure of the detail in a picture. A blank frame is near 0.
|
|
797
864
|
- **LoRA**: a small set of extra weights that trains a model on one subject or style.
|
|
798
865
|
- **musubi-tuner**: the trainer that reads the files of `--trainer musubi` (kohya-ss/musubi-tuner).
|
|
866
|
+
- **Model service**: a curu-vision process that runs EmbeddingGemma 2 and the WD14 tagger for
|
|
867
|
+
other computers, over HTTP with a bearer token. `CURU_VISION_URL` names it.
|
|
799
868
|
- **Near-duplicate**: a frame or file that looks almost the same as another.
|
|
800
869
|
- **Ollama**: the local program that runs the caption model.
|
|
801
870
|
- **Perceptual hash (pHash)**: a 64-bit summary of how a picture looks. Similar pictures have
|
|
@@ -803,9 +872,11 @@ scripts/check.sh --full # also a build from a new clone, before a release or
|
|
|
803
872
|
- **Projection**: the form of caption and media that one model trains on.
|
|
804
873
|
- **Provenance**: the record of which producer made a fact, and with which parameters.
|
|
805
874
|
- **Staging**: work on the local disk, then one copy to the destination.
|
|
875
|
+
- **Temperature**: a setting of the model, usually from 0 to 2. A lower value makes the answers
|
|
876
|
+
change less from one run to the next.
|
|
806
877
|
- **Trigger word**: the word at the start of each caption that calls the LoRA, for example
|
|
807
878
|
`ohwx`.
|
|
808
|
-
- **VLM**: a vision-language model, here the caption model in Ollama.
|
|
879
|
+
- **VLM**: a vision-language model, here the caption model in Ollama or OpenRouter.
|
|
809
880
|
- **WD14 rating**: four scores from the WD14 tagger, `general`, `sensitive`, `questionable` and
|
|
810
881
|
`explicit`, each from 0 to 1. Each score is the probability that the picture has that content
|
|
811
882
|
rating, from `general` (safe) to `explicit`.
|
|
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "curu-caption"
|
|
7
|
-
version = "3.0
|
|
7
|
+
version = "3.1.0"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
license = "MIT"
|
|
10
10
|
license-files = ["LICENSE"]
|
|
@@ -12,11 +12,15 @@ description = "Local-first pipeline: media in, AI-Toolkit-ready LoRA training da
|
|
|
12
12
|
requires-python = ">=3.12"
|
|
13
13
|
dependencies = [
|
|
14
14
|
# The canonical scene model every caption renders from (ADR-088).
|
|
15
|
-
"avdm>=0.
|
|
16
|
-
# The speech, WD14
|
|
17
|
-
# dependency, because a fact's provenance names its pinned
|
|
18
|
-
# media is loaded. Pinned below the next minor release
|
|
19
|
-
|
|
15
|
+
"avdm>=0.3.1,<0.4",
|
|
16
|
+
# The speech, WD14, search-index, d1-3B question and sound models (#115, #163,
|
|
17
|
+
# #196, #185, ADR-097). A core dependency, because a fact's provenance names its pinned
|
|
18
|
+
# model before any media is loaded. Pinned below the next minor release
|
|
19
|
+
# (ADR-097, rule 2). The `gpu` extra holds the transformers that the
|
|
20
|
+
# questions port's CUDA engine and the sound ports are pinned to, and the
|
|
21
|
+
# torchvision that d1-3B's image processor needs. The `cloud` extra is not needed: OpenRouter is an
|
|
22
|
+
# OpenAI-compatible server to the vlm port (#183).
|
|
23
|
+
"curu-vision[gpu]>=0.23.0,<0.24",
|
|
20
24
|
"av>=17",
|
|
21
25
|
"click>=8",
|
|
22
26
|
# The sister capability, not a vendored copy of one. Captioning is the only
|
|
@@ -27,27 +31,23 @@ dependencies = [
|
|
|
27
31
|
# tomlkit; httpx, rich and pydantic it shares with us already.
|
|
28
32
|
"curu-infra>=0.66,<0.73",
|
|
29
33
|
"httpx>=0.27",
|
|
30
|
-
# The quality fact (ADR-090) fetches d1-3B's pinned snapshot itself.
|
|
31
|
-
"huggingface-hub>=1.0",
|
|
32
34
|
"mutagen>=1.48.1",
|
|
33
35
|
"numpy>=2.0,<2.5",
|
|
34
36
|
# curu-vision runs WD14 and the transcription on it (#163, #115); the WD14
|
|
35
|
-
# adapter also asks it for the providers. The range is curu-vision 0.
|
|
37
|
+
# adapter also asks it for the providers. The range is curu-vision 0.13.0's.
|
|
36
38
|
"onnxruntime>=1.31,<1.32",
|
|
37
39
|
"pillow>=10",
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
|
|
41
|
-
"pydantic-ai>=2.0",
|
|
40
|
+
# The VLM answers are validated as pydantic models (Caption, Verdict). Each
|
|
41
|
+
# request goes through curu-vision's vlm port, so pydantic-ai is gone (#183).
|
|
42
|
+
"pydantic>=2",
|
|
42
43
|
"pypng>=0.20220715.0",
|
|
43
44
|
"pyyaml>=6",
|
|
44
45
|
"rich>=13",
|
|
45
46
|
"scikit-learn>=1.3",
|
|
46
|
-
#
|
|
47
|
-
#
|
|
47
|
+
# `audio_models.asr_runtime` asks torch whether CUDA is there. Every model
|
|
48
|
+
# runs in curu-vision now (ADR-097, #185): its gpu extra brings the
|
|
49
|
+
# transformers and torchvision that its ports are pinned to.
|
|
48
50
|
"torch>=2.2",
|
|
49
|
-
"torchvision",
|
|
50
|
-
"transformers>=5.19",
|
|
51
51
|
"watchdog>=4.0",
|
|
52
52
|
]
|
|
53
53
|
|
|
@@ -55,7 +55,7 @@ dependencies = [
|
|
|
55
55
|
gpu = ["onnxruntime-gpu>=1.31,<1.32; sys_platform != 'darwin'"]
|
|
56
56
|
remote = [] # rclone is an external binary (see ADR-020); no pip deps needed
|
|
57
57
|
audio = [
|
|
58
|
-
#
|
|
58
|
+
# The audio decode for the sound and speech facts. The models are curu-vision's.
|
|
59
59
|
"librosa>=0.10",
|
|
60
60
|
"soundfile>=0.12",
|
|
61
61
|
]
|