curu-caption 3.0.2__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.
Files changed (121) hide show
  1. {curu_caption-3.0.2 → curu_caption-3.1.0}/Cargo.lock +3 -3
  2. {curu_caption-3.0.2 → curu_caption-3.1.0}/Cargo.toml +1 -1
  3. curu_caption-3.1.0/LICENSE +21 -0
  4. {curu_caption-3.0.2 → curu_caption-3.1.0}/PKG-INFO +101 -30
  5. {curu_caption-3.0.2 → curu_caption-3.1.0}/README.md +95 -23
  6. {curu_caption-3.0.2 → curu_caption-3.1.0}/pyproject.toml +21 -19
  7. curu_caption-3.1.0/src/curu_caption/adapters/_vision_media.py +46 -0
  8. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/adapters/embeddinggemma.py +18 -2
  9. curu_caption-3.1.0/src/curu_caption/adapters/vision_service.py +237 -0
  10. curu_caption-3.1.0/src/curu_caption/adapters/vlm_captioner.py +471 -0
  11. curu_caption-3.1.0/src/curu_caption/adapters/vlm_judge.py +148 -0
  12. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/adapters/wd14_tagger.py +52 -7
  13. curu_caption-3.1.0/src/curu_caption/audio_models.py +346 -0
  14. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/caption_grounding.py +28 -10
  15. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/commands/corpus_cli.py +53 -35
  16. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/commands/media.py +2 -1
  17. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/config.py +30 -1
  18. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/audio_extractors.py +13 -23
  19. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/cheap_extractors.py +44 -26
  20. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/claim_check.py +110 -21
  21. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/extractors.py +28 -17
  22. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/motion.py +4 -0
  23. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/music.py +18 -9
  24. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/sound_fusion.py +8 -1
  25. curu_caption-3.1.0/src/curu_caption/quality.py +152 -0
  26. curu_caption-3.0.2/src/curu_caption/adapters/_vision_media.py +0 -97
  27. curu_caption-3.0.2/src/curu_caption/adapters/vlm_captioner.py +0 -437
  28. curu_caption-3.0.2/src/curu_caption/adapters/vlm_judge.py +0 -174
  29. curu_caption-3.0.2/src/curu_caption/audio_models.py +0 -344
  30. curu_caption-3.0.2/src/curu_caption/ollama_provider.py +0 -268
  31. curu_caption-3.0.2/src/curu_caption/quality.py +0 -130
  32. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/Cargo.toml +0 -0
  33. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/assets/SEETAFACE_MODEL_LICENSE +0 -0
  34. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/assets/seeta_fd_frontal_v1.0.bin +0 -0
  35. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/benches/filter_1080p.rs +0 -0
  36. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/benches/frame_extraction.rs +0 -0
  37. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/benches/similarity.rs +0 -0
  38. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/aesthetic.rs +0 -0
  39. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/ahash.rs +0 -0
  40. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/atomic_write.rs +0 -0
  41. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/backpressure.rs +0 -0
  42. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/blur_type.rs +0 -0
  43. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/clip.rs +0 -0
  44. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/decode.rs +0 -0
  45. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/embed.rs +0 -0
  46. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/error.rs +0 -0
  47. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/face.rs +0 -0
  48. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/filter.rs +0 -0
  49. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/histogram.rs +0 -0
  50. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/lib.rs +0 -0
  51. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/phash.rs +0 -0
  52. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/quality.rs +0 -0
  53. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/shard_layout.rs +0 -0
  54. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/sharpness.rs +0 -0
  55. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/shot.rs +0 -0
  56. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-core/src/sobel.rs +0 -0
  57. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-ondisk/Cargo.toml +0 -0
  58. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-ondisk/src/atomic_write.rs +0 -0
  59. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-ondisk/src/facts.rs +0 -0
  60. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-ondisk/src/lib.rs +0 -0
  61. {curu_caption-3.0.2 → curu_caption-3.1.0}/crates/curu-ondisk/src/png_meta.rs +0 -0
  62. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/__init__.py +0 -0
  63. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/__main__.py +0 -0
  64. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/_core.pyi +0 -0
  65. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/_tui_launcher.py +0 -0
  66. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/adapters/__init__.py +0 -0
  67. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/adapters/combined_captioner.py +0 -0
  68. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/aitk/__init__.py +0 -0
  69. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/aitk/emitter.py +0 -0
  70. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/batch.py +0 -0
  71. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/cli.py +0 -0
  72. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/comfy/__init__.py +0 -0
  73. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/comfy/infer.py +0 -0
  74. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/comfy/workflow.py +0 -0
  75. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/commands/__init__.py +0 -0
  76. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/commands/comfy.py +0 -0
  77. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/content_version.py +0 -0
  78. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/__init__.py +0 -0
  79. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/avdm_adapter.py +0 -0
  80. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/bundle.py +0 -0
  81. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/bundle_review.py +0 -0
  82. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/conform.py +0 -0
  83. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/cull.py +0 -0
  84. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/cut.py +0 -0
  85. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/derive.py +0 -0
  86. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/encode.py +0 -0
  87. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/enrich.py +0 -0
  88. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/origin.py +0 -0
  89. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/probe.py +0 -0
  90. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/projection.py +0 -0
  91. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/provenance.py +0 -0
  92. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/review_page.html +0 -0
  93. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/role.py +0 -0
  94. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/select.py +0 -0
  95. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/shot_frames.py +0 -0
  96. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/speech.py +0 -0
  97. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/store.py +0 -0
  98. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/trainer_config.py +0 -0
  99. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/trainers.py +0 -0
  100. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/corpus/window.py +0 -0
  101. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/curation/__init__.py +0 -0
  102. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/curation/dedup.py +0 -0
  103. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/curation/judge.py +0 -0
  104. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/facts.py +0 -0
  105. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/infra.py +0 -0
  106. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/local_staging_sync.py +0 -0
  107. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/media_extensions.py +0 -0
  108. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/meta.py +0 -0
  109. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/models.py +0 -0
  110. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/ort_providers.py +0 -0
  111. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/pipeline.py +0 -0
  112. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/ports/__init__.py +0 -0
  113. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/ports/captioning.py +0 -0
  114. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/ports/judging.py +0 -0
  115. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/ports/tagging.py +0 -0
  116. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/progress_report.py +0 -0
  117. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/shard_layout.py +0 -0
  118. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/sidecar.py +0 -0
  119. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/staged_processing.py +0 -0
  120. {curu_caption-3.0.2 → curu_caption-3.1.0}/src/curu_caption/video/__init__.py +0 -0
  121. {curu_caption-3.0.2 → 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.2"
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.2"
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.2"
535
+ version = "3.1.0"
536
536
  dependencies = [
537
537
  "anyhow",
538
538
  "clap",
@@ -11,7 +11,7 @@ members = ["crates/curu-core", "crates/curu-ondisk"]
11
11
  resolver = "2"
12
12
 
13
13
  [workspace.package]
14
- version = "3.0.2"
14
+ version = "3.1.0"
15
15
  edition = "2021"
16
16
 
17
17
  [profile.release]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 James Veitch
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,25 +1,22 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: curu-caption
3
- Version: 3.0.2
4
- Requires-Dist: avdm>=0.2.2,<0.3
5
- Requires-Dist: curu-vision>=0.8.1,<0.9
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-ai>=2.0
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'
@@ -27,7 +24,9 @@ Requires-Dist: onnxruntime-gpu>=1.31,<1.32 ; sys_platform != 'darwin' and extra
27
24
  Provides-Extra: audio
28
25
  Provides-Extra: gpu
29
26
  Provides-Extra: remote
27
+ License-File: LICENSE
30
28
  Summary: Local-first pipeline: media in, AI-Toolkit-ready LoRA training datasets out
29
+ License-Expression: MIT
31
30
  Requires-Python: >=3.12
32
31
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
33
32
  Project-URL: Documentation, https://github.com/darth-veitcher/curu-caption/blob/main/README.md
@@ -72,9 +71,11 @@ default, and no step needs a cloud account.
72
71
 
73
72
  You need Python 3.12 or later, [uv](https://docs.astral.sh/uv/), a Rust toolchain
74
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.
75
76
 
76
77
  To install the released package from PyPI, you need only Python 3.12 or later, uv, ffmpeg and
77
- Ollama:
78
+ Ollama. On a computer with no CUDA GPU, you also need `llama-server`:
78
79
 
79
80
  ```bash
80
81
  uv tool install "curu-caption[audio]" # curu-caption and curu-caption-tui on the PATH
@@ -245,7 +246,7 @@ second run of `index` prints:
245
246
  ```text
246
247
  index 7 kept item(s) in photo-corpus (4 culled, excluded or detection-only, not indexed)
247
248
  indexing with EmbeddingGemma 2 (curu-vision)
248
- judging quality with LiquidAI/d1-3B — a review pre-sort, never a gate
249
+ judging quality with d1-3B (curu_vision.questions, gguf engine) — a review pre-sort, never a gate
249
250
  embedding: 0 extracted, 7 already current
250
251
  quality: 0 extracted, 7 already current
251
252
 
@@ -255,8 +256,8 @@ index ready — photo-corpus
255
256
  `index` reads only the kept items. It does not make a fact again when the fact is current for
256
257
  its model and parameters. Thus a second run does nothing, as in the example output.
257
258
 
258
- Run `index` again on each corpus after a change to the index model. The embedding fact records the model and
259
- 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
260
261
  not use a stale vector, and `index` makes it again. curu-vision puts each transparent part of a
261
262
  picture onto white before the embedding.
262
263
 
@@ -292,10 +293,17 @@ rating of live-action footage is not accurate.
292
293
  | Step | On a CUDA GPU | On a CPU or Apple silicon |
293
294
  |---|---|---|
294
295
  | Index (EmbeddingGemma 2) | not measured; it needs the `gpu` extra | about 5.4 s for each 1280x720 frame (Apple M1 CPU) |
295
- | Quality (d1-3B) | about 0.25 s for each item (RTX 3090) | about 2 minutes for each item (16 GB Apple M1) |
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) |
296
297
  | WD14 tags and rating (`--tags`) | — | about 4.5 s for each item (the `--tags` help) |
297
298
 
298
- On a Mac, use `--no-quality` and run `index` later on a computer with a GPU.
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.
299
307
 
300
308
  ## Find items by meaning
301
309
 
@@ -352,7 +360,9 @@ train. The default is `ltx`.
352
360
  | `h3-prose` | Prose of the picture and the motion, with no audio | as `h3` |
353
361
 
354
362
  - **Captions.** The caption model fills in a fixed form of claims about the middle frame of the
355
- item. Then d1-3B checks each claim with a yes or no question. The caption keeps only the
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
356
366
  checked claims, one plain sentence for each.
357
367
  - **Missing facts.** `--dry-run` names each fact that the projection needs and the corpus does
358
368
  not have. `ltx` needs a `sound` fact, and `h3` uses one when it has it. `--caption` makes it
@@ -541,6 +551,10 @@ Judged 4 image(s): 3 keep, 1 reject.
541
551
  Each line gives the verdict and the reason of the model. If the model rejects all the images,
542
552
  `judge` changes each verdict to keep and says so. Then the criteria are too strict or not
543
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.
544
558
  ## Write dataset.yaml for a folder
545
559
 
546
560
  `dataset-config` writes the `dataset.yaml` that AI-Toolkit trains from, for a folder of media
@@ -652,6 +666,19 @@ model = "saracen9/amoral-qwen3.8-27b"
652
666
  providers = "cpu"
653
667
  ```
654
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
+
655
682
  Each setting, environment variable and file on disk is in
656
683
  [docs/configuration.md](docs/configuration.md).
657
684
 
@@ -701,7 +728,8 @@ exit code 1
701
728
  - **The picture is checked, not proven.** On 40 test frames, 88 of the 898 claims that the check
702
729
  kept were false (precision 0.90, against 0.81 for the old prose captions). Most errors are
703
730
  upper garments, the direction that a person faces, and headwear. The check of helmets is poor,
704
- 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.
705
733
  - **`--provider openrouter` ignores the corpus prompts.** It does not get the claims form or the
706
734
  motion and sound prompts. Use Ollama for the captions of a cut. `cut --caption` has no cloud
707
735
  provider.
@@ -711,13 +739,21 @@ exit code 1
711
739
  - **`review` does not sort by quality**, because it cannot read the facts of a clip yet
712
740
  ([#87](https://github.com/darth-veitcher/curu-caption/issues/87)).
713
741
  - **`review` has no mouse** ([#101](https://github.com/darth-veitcher/curu-caption/issues/101)).
714
- - **d1-3B is slow without CUDA.** On a Mac, the quality scores and the claim check run on the
715
- CPU, and take minutes for each item.
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.
716
751
  - **It does not train.** curu-caption makes datasets. AI-Toolkit trains.
717
752
 
718
753
  ## Technical notes
719
754
 
720
- - **Version.** 3.0.2, set in `pyproject.toml` (`project.version`) and in `Cargo.toml`
755
+ - **Licence.** MIT ([LICENSE](LICENSE)).
756
+ - **Version.** 3.1.0, set in `pyproject.toml` (`project.version`) and in `Cargo.toml`
721
757
  (`workspace.package.version`). The changes are in [CHANGELOG.md](CHANGELOG.md).
722
758
  - **Build.** `uv sync` builds `crates/curu-core` into `curu_caption._core` with maturin.
723
759
  `crates/curu-tui` is the `review` program, and `crates/curu-ondisk` writes PNG text chunks.
@@ -725,18 +761,42 @@ exit code 1
725
761
  `[tool.uv] cache-keys` in `pyproject.toml` lists the files that cause a new build. On Linux,
726
762
  the extension contains its own copy of liblzma, a compression library, so it needs no system
727
763
  copy.
728
- - **Platforms.** macOS and Linux. On Apple silicon, the models run on the CPU: CoreML was 1.6 to
729
- 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.
730
767
  - **ffmpeg.** On x86_64, the Rust core downloads ffmpeg when it is not on the `PATH`. On other
731
768
  platforms, install it.
732
769
  - **Models.** Each model downloads on first use, at a pinned revision. EmbeddingGemma 2 (1.8 GB)
733
- is the index, and d1-3B (6.2 GB) gives the quality scores and the claim check. WD14 (455 MB)
734
- gives the tags and the rating. EmbeddingGemma 2 and WD14 come from curu-vision, which checks
735
- their SHA-256.
736
- - **Audio models.** The sound captioner (about 1 GB) and AST (346 MB) download into the cache of
737
- this project. AST is an audio tagger that gives a probability for each AudioSet sound
738
- label. Speech comes from curu-vision: MOSS (1.8 GB) on a computer with CUDA, which
739
- labels speakers, and Parakeet (2.4 GB) on other computers.
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.
740
800
  - **Tutorials.** The records of real training runs use the commands of version 2.0, which do
741
801
  not exist now. They are in
742
802
  [project-management/archive/tutorials-v2/](project-management/archive/tutorials-v2/README.md).
@@ -800,8 +860,8 @@ scripts/check.sh --full # also a build from a new clone, before a release or
800
860
  - **AAC**: a lossy audio format: the decoded audio is not the same as the audio before the
801
861
  encode. An MP4 file usually holds AAC audio.
802
862
  - **AI-Toolkit**: the trainer that reads a `dataset.yaml` or a `job.yaml` (ostris/ai-toolkit).
803
- - **AST**: an audio tagger that gives a probability for each AudioSet sound label. The `music`
804
- 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.
805
865
  - **AUROC**: the probability that a score puts a good item above a bad item. 0.5 is chance, and
806
866
  1.0 is always correct.
807
867
  - **AVDM**: the scene document that each caption comes from (the `avdm` package).
@@ -818,10 +878,17 @@ scripts/check.sh --full # also a build from a new clone, before a release or
818
878
  - **d1-3B**: a LiquidAI model that gives the quality scores and the claim check.
819
879
  - **dBFS**: the level of a sound sample in decibels (dB), where 0 dBFS is full scale. A lower
820
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.
821
883
  - **Diarization**: a step that finds who speaks when, in an audio track.
822
884
  - **Embedding**: a list of numbers for a picture or a text. Items with a similar meaning have
823
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`.
824
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.
825
892
  - **FLAC**: a lossless audio format. The decoded audio is the same as the audio before the
826
893
  encode.
827
894
  - **Full scale**: the loudest sample value that a digital audio format can hold. The format
@@ -830,6 +897,8 @@ scripts/check.sh --full # also a build from a new clone, before a release or
830
897
  - **Laplacian variance**: a measure of the detail in a picture. A blank frame is near 0.
831
898
  - **LoRA**: a small set of extra weights that trains a model on one subject or style.
832
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.
833
902
  - **Near-duplicate**: a frame or file that looks almost the same as another.
834
903
  - **Ollama**: the local program that runs the caption model.
835
904
  - **Perceptual hash (pHash)**: a 64-bit summary of how a picture looks. Similar pictures have
@@ -837,9 +906,11 @@ scripts/check.sh --full # also a build from a new clone, before a release or
837
906
  - **Projection**: the form of caption and media that one model trains on.
838
907
  - **Provenance**: the record of which producer made a fact, and with which parameters.
839
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.
840
911
  - **Trigger word**: the word at the start of each caption that calls the LoRA, for example
841
912
  `ohwx`.
842
- - **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.
843
914
  - **WD14 rating**: four scores from the WD14 tagger, `general`, `sensitive`, `questionable` and
844
915
  `explicit`, each from 0 to 1. Each score is the probability that the picture has that content
845
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 LiquidAI/d1-3B — a review pre-sort, never a gate
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 and
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 2 minutes for each item (16 GB Apple M1) |
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
- On a Mac, use `--no-quality` and run `index` later on a computer with a GPU.
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. Then d1-3B checks each claim with a yes or no question. The caption keeps only the
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,13 +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 on the
680
- CPU, and take minutes for each item.
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
- - **Version.** 3.0.2, set in `pyproject.toml` (`project.version`) and in `Cargo.toml`
721
+ - **Licence.** MIT ([LICENSE](LICENSE)).
722
+ - **Version.** 3.1.0, set in `pyproject.toml` (`project.version`) and in `Cargo.toml`
686
723
  (`workspace.package.version`). The changes are in [CHANGELOG.md](CHANGELOG.md).
687
724
  - **Build.** `uv sync` builds `crates/curu-core` into `curu_caption._core` with maturin.
688
725
  `crates/curu-tui` is the `review` program, and `crates/curu-ondisk` writes PNG text chunks.
@@ -690,18 +727,42 @@ exit code 1
690
727
  `[tool.uv] cache-keys` in `pyproject.toml` lists the files that cause a new build. On Linux,
691
728
  the extension contains its own copy of liblzma, a compression library, so it needs no system
692
729
  copy.
693
- - **Platforms.** macOS and Linux. On Apple silicon, the models run on the CPU: CoreML was 1.6 to
694
- 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.
695
733
  - **ffmpeg.** On x86_64, the Rust core downloads ffmpeg when it is not on the `PATH`. On other
696
734
  platforms, install it.
697
735
  - **Models.** Each model downloads on first use, at a pinned revision. EmbeddingGemma 2 (1.8 GB)
698
- is the index, and d1-3B (6.2 GB) gives the quality scores and the claim check. WD14 (455 MB)
699
- gives the tags and the rating. EmbeddingGemma 2 and WD14 come from curu-vision, which checks
700
- their SHA-256.
701
- - **Audio models.** The sound captioner (about 1 GB) and AST (346 MB) download into the cache of
702
- this project. AST is an audio tagger that gives a probability for each AudioSet sound
703
- label. Speech comes from curu-vision: MOSS (1.8 GB) on a computer with CUDA, which
704
- labels speakers, and Parakeet (2.4 GB) on other computers.
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.
705
766
  - **Tutorials.** The records of real training runs use the commands of version 2.0, which do
706
767
  not exist now. They are in
707
768
  [project-management/archive/tutorials-v2/](project-management/archive/tutorials-v2/README.md).
@@ -765,8 +826,8 @@ scripts/check.sh --full # also a build from a new clone, before a release or
765
826
  - **AAC**: a lossy audio format: the decoded audio is not the same as the audio before the
766
827
  encode. An MP4 file usually holds AAC audio.
767
828
  - **AI-Toolkit**: the trainer that reads a `dataset.yaml` or a `job.yaml` (ostris/ai-toolkit).
768
- - **AST**: an audio tagger that gives a probability for each AudioSet sound label. The `music`
769
- 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.
770
831
  - **AUROC**: the probability that a score puts a good item above a bad item. 0.5 is chance, and
771
832
  1.0 is always correct.
772
833
  - **AVDM**: the scene document that each caption comes from (the `avdm` package).
@@ -783,10 +844,17 @@ scripts/check.sh --full # also a build from a new clone, before a release or
783
844
  - **d1-3B**: a LiquidAI model that gives the quality scores and the claim check.
784
845
  - **dBFS**: the level of a sound sample in decibels (dB), where 0 dBFS is full scale. A lower
785
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.
786
849
  - **Diarization**: a step that finds who speaks when, in an audio track.
787
850
  - **Embedding**: a list of numbers for a picture or a text. Items with a similar meaning have
788
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`.
789
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.
790
858
  - **FLAC**: a lossless audio format. The decoded audio is the same as the audio before the
791
859
  encode.
792
860
  - **Full scale**: the loudest sample value that a digital audio format can hold. The format
@@ -795,6 +863,8 @@ scripts/check.sh --full # also a build from a new clone, before a release or
795
863
  - **Laplacian variance**: a measure of the detail in a picture. A blank frame is near 0.
796
864
  - **LoRA**: a small set of extra weights that trains a model on one subject or style.
797
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.
798
868
  - **Near-duplicate**: a frame or file that looks almost the same as another.
799
869
  - **Ollama**: the local program that runs the caption model.
800
870
  - **Perceptual hash (pHash)**: a 64-bit summary of how a picture looks. Similar pictures have
@@ -802,9 +872,11 @@ scripts/check.sh --full # also a build from a new clone, before a release or
802
872
  - **Projection**: the form of caption and media that one model trains on.
803
873
  - **Provenance**: the record of which producer made a fact, and with which parameters.
804
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.
805
877
  - **Trigger word**: the word at the start of each caption that calls the LoRA, for example
806
878
  `ohwx`.
807
- - **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.
808
880
  - **WD14 rating**: four scores from the WD14 tagger, `general`, `sensitive`, `questionable` and
809
881
  `explicit`, each from 0 to 1. Each score is the probability that the picture has that content
810
882
  rating, from `general` (safe) to `explicit`.
@@ -1,20 +1,26 @@
1
1
  [build-system]
2
- requires = ["maturin>=1.7,<2.0"]
2
+ requires = ["maturin>=1.9,<2.0"]
3
3
  build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "curu-caption"
7
- version = "3.0.2"
7
+ version = "3.1.0"
8
8
  readme = "README.md"
9
+ license = "MIT"
10
+ license-files = ["LICENSE"]
9
11
  description = "Local-first pipeline: media in, AI-Toolkit-ready LoRA training datasets out"
10
12
  requires-python = ">=3.12"
11
13
  dependencies = [
12
14
  # The canonical scene model every caption renders from (ADR-088).
13
- "avdm>=0.2.2,<0.3",
14
- # The speech, WD14 and search-index models (#115, #163, ADR-097). A core
15
- # dependency, because a fact's provenance names its pinned model before any
16
- # media is loaded. Pinned below the next minor release (ADR-097, rule 2).
17
- "curu-vision>=0.8.1,<0.9",
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",
18
24
  "av>=17",
19
25
  "click>=8",
20
26
  # The sister capability, not a vendored copy of one. Captioning is the only
@@ -25,27 +31,23 @@ dependencies = [
25
31
  # tomlkit; httpx, rich and pydantic it shares with us already.
26
32
  "curu-infra>=0.66,<0.73",
27
33
  "httpx>=0.27",
28
- # The quality fact (ADR-090) fetches d1-3B's pinned snapshot itself.
29
- "huggingface-hub>=1.0",
30
34
  "mutagen>=1.48.1",
31
35
  "numpy>=2.0,<2.5",
32
36
  # curu-vision runs WD14 and the transcription on it (#163, #115); the WD14
33
- # adapter also asks it for the providers. The range is curu-vision 0.8.1's.
37
+ # adapter also asks it for the providers. The range is curu-vision 0.13.0's.
34
38
  "onnxruntime>=1.31,<1.32",
35
39
  "pillow>=10",
36
- # No [openai] extra: it existed in pydantic-ai 0.x and was folded into the
37
- # base package by 2.x, so requesting it emits a resolver warning and pins
38
- # nothing. The OpenAI-compatible provider is available from the base install.
39
- "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",
40
43
  "pypng>=0.20220715.0",
41
44
  "pyyaml>=6",
42
45
  "rich>=13",
43
46
  "scikit-learn>=1.3",
44
- # The d1-3B quality judge (quality.py) and the audio models (audio_models.py).
45
- # The search index is curu-vision's ONNX EmbeddingGemma 2 (ADR-097).
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.
46
50
  "torch>=2.2",
47
- "torchvision",
48
- "transformers>=5.19",
49
51
  "watchdog>=4.0",
50
52
  ]
51
53
 
@@ -53,7 +55,7 @@ dependencies = [
53
55
  gpu = ["onnxruntime-gpu>=1.31,<1.32; sys_platform != 'darwin'"]
54
56
  remote = [] # rclone is an external binary (see ADR-020); no pip deps needed
55
57
  audio = [
56
- # torch and transformers are core dependencies (the quality judge needs them).
58
+ # The audio decode for the sound and speech facts. The models are curu-vision's.
57
59
  "librosa>=0.10",
58
60
  "soundfile>=0.12",
59
61
  ]