curu-caption 3.6.0__tar.gz → 3.7.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 (119) hide show
  1. {curu_caption-3.6.0 → curu_caption-3.7.0}/Cargo.lock +3 -3
  2. {curu_caption-3.6.0 → curu_caption-3.7.0}/Cargo.toml +1 -1
  3. {curu_caption-3.6.0 → curu_caption-3.7.0}/PKG-INFO +3 -3
  4. {curu_caption-3.6.0 → curu_caption-3.7.0}/pyproject.toml +14 -11
  5. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/commands/corpus_cli.py +1 -1
  6. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/avdm_adapter.py +40 -1
  7. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/claim_check.py +32 -1
  8. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/timeline_visual.py +32 -1
  9. {curu_caption-3.6.0 → curu_caption-3.7.0}/LICENSE +0 -0
  10. {curu_caption-3.6.0 → curu_caption-3.7.0}/README.md +0 -0
  11. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/Cargo.toml +0 -0
  12. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/assets/SEETAFACE_MODEL_LICENSE +0 -0
  13. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/assets/seeta_fd_frontal_v1.0.bin +0 -0
  14. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/benches/filter_1080p.rs +0 -0
  15. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/benches/frame_extraction.rs +0 -0
  16. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/benches/similarity.rs +0 -0
  17. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/aesthetic.rs +0 -0
  18. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/ahash.rs +0 -0
  19. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/atomic_write.rs +0 -0
  20. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/backpressure.rs +0 -0
  21. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/blur_type.rs +0 -0
  22. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/clip.rs +0 -0
  23. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/decode.rs +0 -0
  24. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/embed.rs +0 -0
  25. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/error.rs +0 -0
  26. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/face.rs +0 -0
  27. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/filter.rs +0 -0
  28. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/histogram.rs +0 -0
  29. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/lib.rs +0 -0
  30. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/phash.rs +0 -0
  31. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/quality.rs +0 -0
  32. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/shard_layout.rs +0 -0
  33. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/sharpness.rs +0 -0
  34. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/shot.rs +0 -0
  35. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-core/src/sobel.rs +0 -0
  36. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-ondisk/Cargo.toml +0 -0
  37. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-ondisk/src/atomic_write.rs +0 -0
  38. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-ondisk/src/facts.rs +0 -0
  39. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-ondisk/src/lib.rs +0 -0
  40. {curu_caption-3.6.0 → curu_caption-3.7.0}/crates/curu-ondisk/src/png_meta.rs +0 -0
  41. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/__init__.py +0 -0
  42. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/__main__.py +0 -0
  43. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/_core.pyi +0 -0
  44. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/_tui_launcher.py +0 -0
  45. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/adapters/__init__.py +0 -0
  46. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/adapters/_vision_media.py +0 -0
  47. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/adapters/combined_captioner.py +0 -0
  48. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/adapters/embeddinggemma.py +0 -0
  49. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/adapters/vision_service.py +0 -0
  50. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/adapters/vlm_captioner.py +0 -0
  51. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/adapters/vlm_judge.py +0 -0
  52. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/adapters/wd14_tagger.py +0 -0
  53. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/aitk/__init__.py +0 -0
  54. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/aitk/emitter.py +0 -0
  55. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/audio_models.py +0 -0
  56. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/batch.py +0 -0
  57. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/caption_grounding.py +0 -0
  58. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/cli.py +0 -0
  59. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/comfy/__init__.py +0 -0
  60. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/comfy/infer.py +0 -0
  61. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/comfy/workflow.py +0 -0
  62. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/commands/__init__.py +0 -0
  63. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/commands/comfy.py +0 -0
  64. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/commands/media.py +0 -0
  65. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/config.py +0 -0
  66. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/content_version.py +0 -0
  67. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/__init__.py +0 -0
  68. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/audio_extractors.py +0 -0
  69. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/bundle.py +0 -0
  70. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/bundle_review.py +0 -0
  71. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/cheap_extractors.py +0 -0
  72. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/conform.py +0 -0
  73. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/cull.py +0 -0
  74. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/cut.py +0 -0
  75. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/derive.py +0 -0
  76. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/encode.py +0 -0
  77. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/enrich.py +0 -0
  78. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/extractors.py +0 -0
  79. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/motion.py +0 -0
  80. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/music.py +0 -0
  81. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/origin.py +0 -0
  82. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/probe.py +0 -0
  83. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/projection.py +0 -0
  84. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/provenance.py +0 -0
  85. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/review_page.html +0 -0
  86. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/role.py +0 -0
  87. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/select.py +0 -0
  88. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/shot_frames.py +0 -0
  89. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/sound_fusion.py +0 -0
  90. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/speech.py +0 -0
  91. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/store.py +0 -0
  92. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/timeline.py +0 -0
  93. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/timeline_audio.py +0 -0
  94. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/timeline_av.py +0 -0
  95. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/trainer_config.py +0 -0
  96. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/trainers.py +0 -0
  97. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/corpus/window.py +0 -0
  98. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/curation/__init__.py +0 -0
  99. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/curation/dedup.py +0 -0
  100. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/curation/judge.py +0 -0
  101. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/facts.py +0 -0
  102. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/infra.py +0 -0
  103. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/local_staging_sync.py +0 -0
  104. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/media_extensions.py +0 -0
  105. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/meta.py +0 -0
  106. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/models.py +0 -0
  107. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/ort_providers.py +0 -0
  108. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/pipeline.py +0 -0
  109. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/ports/__init__.py +0 -0
  110. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/ports/captioning.py +0 -0
  111. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/ports/judging.py +0 -0
  112. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/ports/tagging.py +0 -0
  113. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/progress_report.py +0 -0
  114. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/quality.py +0 -0
  115. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/shard_layout.py +0 -0
  116. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/sidecar.py +0 -0
  117. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/staged_processing.py +0 -0
  118. {curu_caption-3.6.0 → curu_caption-3.7.0}/src/curu_caption/video/__init__.py +0 -0
  119. {curu_caption-3.6.0 → curu_caption-3.7.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.6.0"
498
+ version = "3.7.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.6.0"
522
+ version = "3.7.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.6.0"
535
+ version = "3.7.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.6.0"
14
+ version = "3.7.0"
15
15
  edition = "2021"
16
16
 
17
17
  [profile.release]
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: curu-caption
3
- Version: 3.6.0
4
- Requires-Dist: avdm>=0.4.0,<0.5
5
- Requires-Dist: curu-vision[gpu]>=0.38.0,<0.39
3
+ Version: 3.7.0
4
+ Requires-Dist: avdm>=0.5.0,<0.6
5
+ Requires-Dist: curu-vision[gpu]>=0.39.0,<0.40
6
6
  Requires-Dist: av>=17
7
7
  Requires-Dist: click>=8
8
8
  Requires-Dist: curu-infra>=0.66,<0.73
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "curu-caption"
7
- version = "3.6.0"
7
+ version = "3.7.0"
8
8
  readme = "README.md"
9
9
  license = "MIT"
10
10
  license-files = ["LICENSE"]
@@ -16,10 +16,11 @@ dependencies = [
16
16
  # deliberate style step (issue #205), whose form the prompt fingerprint
17
17
  # and the fact provenance name. 0.3.4 fixes the caller-claim-plus-form
18
18
  # flow in avdm assemble (#12).
19
- # avdm 0.4.0 is the floor with curu-vision 0.37.0, which requires it: its
20
- # caption form is captions-6, so every `visual` fact goes stale again
21
- # (issue #213), and `cut --caption` makes them again. There is no migration.
22
- "avdm>=0.4.0,<0.5",
19
+ # avdm 0.5.0 is the floor with curu-vision 0.39.0, which requires it: its
20
+ # caption form is captions-8 and its claim check claims-5, so every stored
21
+ # `visual` and `claim_check` fact goes stale (issue #213), and `cut
22
+ # --caption` makes them again. There is no migration.
23
+ "avdm>=0.5.0,<0.6",
23
24
  # The speech, WD14, search-index, d1-3B question and sound models (#115, #163,
24
25
  # #196, #185, ADR-097). A core dependency, because a fact's provenance names its pinned
25
26
  # model before any media is loaded. Pinned below the next minor release
@@ -30,16 +31,18 @@ dependencies = [
30
31
  # 0.33.0 (the sync port, the 1 MP face tracker and `measured_threshold()`,
31
32
  # issue #205) is the floor; 0.35.1 (the face entry keyed to `face-track-2`
32
33
  # at the 1 MP bound, curu-vision#164) is the floor of the face gate, and
33
- # 0.38.0 (captions-7, ffprobe-2, and the opt-in known-entities machinery,
34
- # spec 029) is the floor: the caption form move makes each stored `visual`
35
- # fact stale, and `cut --caption` makes them again. The opt-in references
34
+ # 0.39.0 (captions-8, claims-5, and the medium/production split, avdm#16)
35
+ # is the floor: the caption form move makes each stored `visual` fact
36
+ # stale, and `cut --caption` makes them again. The opt-in references
36
37
  # and names stay opt-in here (the owner decides; ADR-041 keeps an ungated
37
- # binding a selection signal). 0.37.0 (the moss-3 token rule and the
38
- # truncated transcript, curu-vision#175;
38
+ # binding a selection signal) — now on the owner's rule for `production`
39
+ # (2026-11-15: the library is professional). 0.38.0 (captions-7, ffprobe-2,
40
+ # the opt-in known-entities machinery, spec 029), and 0.37.0 (the moss-3
41
+ # token rule and the truncated transcript, curu-vision#175;
39
42
  # the GPU-only onnxruntime with preloaded libraries on Linux x86_64,
40
43
  # curu-vision#173) is the floor. The range is one minor, as curu-vision's
41
44
  # ports move together.
42
- "curu-vision[gpu]>=0.38.0,<0.39",
45
+ "curu-vision[gpu]>=0.39.0,<0.40",
43
46
  "av>=17",
44
47
  "click>=8",
45
48
  # The sister capability, not a vendored copy of one. Captioning is the only
@@ -1665,7 +1665,7 @@ def _timeline_builder(
1665
1665
  console.print("[red]timeline asked, but nothing could run here[/]")
1666
1666
  sys.exit(1)
1667
1667
 
1668
- audio_kinds = {"sound-event", "audio-caption", "sync", "active-speaker"}
1668
+ audio_kinds = {"sound-event", "audio-caption", "sync", "active-speaker", "speaker-face"}
1669
1669
 
1670
1670
  def build(clip_path: Path, row: Mapping[str, Any]) -> list[object]:
1671
1671
  # A row without an `audio` key names no wav: an audio-removed clip has
@@ -98,7 +98,8 @@ def scene_from_facts(
98
98
  observations.append(_observe("depiction", visual, asset))
99
99
  else:
100
100
  picture, limitations, checked_by = _checked_picture(visual, facts.get(claim_check.KIND))
101
- shot_attributes, entities = list(picture.shot.attributes), list(picture.entities)
101
+ shot_attributes = caller_production(list(picture.shot.attributes), limitations)
102
+ entities = list(picture.entities)
102
103
  observations.append(
103
104
  _observe(
104
105
  "depiction", visual, asset,
@@ -193,6 +194,44 @@ def _checked_picture(
193
194
  #: The id of the depiction observation; every picture claim names it.
194
195
  DEPICTION = "O-depiction"
195
196
 
197
+
198
+ #: The caller rule for the production claim (2026-11-15, issue #213): the
199
+ #: caller's library is films and TV, so the rule value is professional;
200
+ #: amateur needs a source fact that says the recording is private, which
201
+ #: curu-caption has not. The claim check does not measure production, so the
202
+ #: rule decides, and the claim rides with its provenance, not the model's.
203
+ _RULE_PRODUCTION = "professional"
204
+
205
+
206
+ def caller_production(
207
+ attributes: list[avdm.ShotAttribute], limitations: list[str]
208
+ ) -> list[avdm.ShotAttribute]:
209
+ """*attributes* with the caller rule's `production` claim set.
210
+
211
+ A production claim the model made is replaced by the rule's, and none
212
+ becomes one — the rule is the caller's knowledge, never the model's. The
213
+ replacement and the set value are noted in *limitations*, which land in the
214
+ document's provenance.
215
+ """
216
+ kept: list[avdm.ShotAttribute] = []
217
+ replaced = 0
218
+ for attribute in attributes:
219
+ if attribute.name == "production":
220
+ replaced += 1
221
+ continue
222
+ kept.append(attribute)
223
+ kept.append(
224
+ avdm.ShotAttribute(
225
+ name="production", status="specified", value=_RULE_PRODUCTION, observation_ref=DEPICTION
226
+ )
227
+ )
228
+ limitations.append(
229
+ f"production set by the caller rule to {_RULE_PRODUCTION}"
230
+ + (f" ({replaced} model production claim(s) replaced)" if replaced else "")
231
+ )
232
+ return kept
233
+
234
+
196
235
  _REPORTED = (
197
236
  (claim_check.REMOVED, f"removed by the claim check (margin below {claim_check.KEEP_MARGIN})"),
198
237
  (claim_check.DROPPED_DECISION, "dropped, never checked"),
@@ -141,6 +141,8 @@ CLOSED: dict[str, dict[str, str]] = {
141
141
  },
142
142
  "members": {v: f"Is {{r}} a group of {plural}?" for v, plural in MEMBERS.items()},
143
143
  "count": {v: f"Does {{r}} have {v} members?" for v in ("2 to 6", "7 to 20", "more than 20")},
144
+ # Legacy: stored captions-7 facts carry `style`; avdm 0.5 keeps the name
145
+ # in SHOT_TERMS, and stale facts never reach the check.
144
146
  "style": {
145
147
  "photograph": "Is this picture a photograph, taken by a camera?",
146
148
  "home video": "Is this picture from a home video?",
@@ -150,6 +152,35 @@ CLOSED: dict[str, dict[str, str]] = {
150
152
  "painting": "Is this picture a painting?",
151
153
  "render": "Is this picture a computer render?",
152
154
  },
155
+ "medium": {
156
+ "photograph": "Is this picture a photograph, taken by a camera?",
157
+ "moving pictures": "Is this picture moving pictures (a video recording)?",
158
+ "animation": "Is this picture animated (drawn or computer-made)?",
159
+ "illustration": "Is this picture an illustration (a drawn picture)?",
160
+ "painting": "Is this picture a painting?",
161
+ "render": "Is this picture a computer render?",
162
+ },
163
+ "production": {
164
+ "professional": "Was this picture made professionally (a film or a TV programme)?",
165
+ "amateur": "Is this picture a private recording?",
166
+ },
167
+ "genre": {
168
+ g: f"Does this picture fit the genre {g}?"
169
+ for g in (
170
+ "comedy",
171
+ "drama",
172
+ "documentary",
173
+ "news",
174
+ "sport",
175
+ "music",
176
+ "animation",
177
+ "adult",
178
+ "talk show",
179
+ "reality",
180
+ "advert",
181
+ "other",
182
+ )
183
+ },
153
184
  "shot_size": {
154
185
  "extreme close-up": "Is this picture an extreme close-up, showing only part of a face?",
155
186
  "close-up": "Is this picture a close-up, showing the head and shoulders?",
@@ -230,7 +261,7 @@ CHUNK = 60
230
261
  #: P(claimed) minus the best P(other value); a free claim's is 2 P(yes) - 1.
231
262
  KEEP_MARGIN: Final = -0.2
232
263
  #: d1 says yes to most shot sizes, so its answer cannot tell them apart.
233
- UNCHECKED: Final = frozenset({"shot_size"})
264
+ UNCHECKED: Final = frozenset({"shot_size", "production", "genre"})
234
265
  #: Never rendered: B6 found accessories unreliable and fixed this before the test.
235
266
  DROPPED: Final = frozenset({"accessory"})
236
267
 
@@ -125,6 +125,32 @@ def _gate(kind: str, provenance: EntityProvenance, measured: MeasuredLookup) ->
125
125
  )
126
126
 
127
127
 
128
+ def _bounded_parts(
129
+ spans: list[tuple[int, list | None]], max_frames: int
130
+ ) -> list[tuple[int, list | None, int]]:
131
+ """The spans, each at most `max_frames` frames: a longer span tracks in
132
+ parts (amoral's 3.5.0 run lost its long clips to curu-vision's own bound,
133
+ #213). A part record names its part, and a part's frames stay the span's
134
+ own order."""
135
+ counts: dict[int, int] = {}
136
+ out: list[tuple[int, list | None, int]] = []
137
+ for shot_index, span in spans:
138
+ if span is None or len(span) <= max_frames:
139
+ out.append((shot_index, span, 0))
140
+ continue
141
+ part: list = []
142
+ for frame in span:
143
+ part.append(frame)
144
+ if len(part) == max_frames:
145
+ out.append((shot_index, part, counts.get(shot_index, 0)))
146
+ counts[shot_index] = counts.get(shot_index, 0) + 1
147
+ part = []
148
+ if part:
149
+ out.append((shot_index, part, counts.get(shot_index, 0)))
150
+ counts[shot_index] = counts.get(shot_index, 0) + 1
151
+ return out
152
+
153
+
128
154
  def _frames_every(media: Media, source: VideoSource, rate: float) -> Any:
129
155
  """The clip's frames every `1 / rate` seconds, for the person ports."""
130
156
  return media.frames_every(source, rate=rate)
@@ -248,12 +274,14 @@ class PersonTrackExtractor:
248
274
  rate: float = 25.0,
249
275
  frames: FramesLoader = _frames_every,
250
276
  measured: MeasuredLookup = _measured_entry,
277
+ max_frames: int = 300,
251
278
  ) -> None:
252
279
  self._tracker = tracker
253
280
  self._media = media
254
281
  self._rate = rate
255
282
  self._frames = frames
256
283
  self._measured = measured
284
+ self._max_frames = max_frames
257
285
 
258
286
  def provenance(self, result: Tracks) -> Provenance:
259
287
  """The provenance of a fact made from *result*, as `FaceTrackExtractor`."""
@@ -301,7 +329,9 @@ class PersonTrackExtractor:
301
329
  raise ExtractionError(
302
330
  f"{media_path.name}: the person tracker failed: {describe(exc)}"
303
331
  ) from exc
304
- for shot_index, span in self._shot_spans(source, frames):
332
+ spans = self._shot_spans(source, frames)
333
+ spans = _bounded_parts(spans, self._max_frames)
334
+ for shot_index, span, shot_part in spans:
305
335
  try:
306
336
  if span is None:
307
337
  result = self._tracker.track(frames)
@@ -325,6 +355,7 @@ class PersonTrackExtractor:
325
355
  value={
326
356
  "track_id": mask.track_id,
327
357
  "shot": shot_index,
358
+ "part": shot_part,
328
359
  "box": _box(mask.box),
329
360
  },
330
361
  confidence=mask.score,
File without changes
File without changes