avdm
The Audiovisual Scene Data Model (AVDM-001), revision 0.3: one canonical document for one shot, and the serializers that render it into the text a video model reads.
media ──observe──▶ SceneDocument ──render──▶ caption / prompt ──generate──▶ media
(observed) to_h3, to_prose
SceneDocument (planned) ──render──┘
The same serializer writes a training caption from an observed document and an inference prompt from a planned one, so the two registers match by construction.
What is in 0.3
| Part | File |
|---|---|
| JSON Schema, the source of truth | src/avdm/schema/avdm-0.3.schema.json |
| Entity kinds and attribute vocabulary, one table | src/avdm/vocabulary.py |
| The form an observer model fills in | src/avdm/observe.py |
| Typed models (pydantic v2), mirrored by hand | src/avdm/model.py |
Evidence rules: assess, assemble, validate |
src/avdm/evidence.py |
Serializers: to_h3, to_prose, to_ste |
src/avdm/render.py |
| Token budget warning | src/avdm/budget.py |
| The annotation record, term ids and mask text | src/avdm/annotation.py |
| The generation record and its lineage | src/avdm/generation.py |
| The scene sequence | src/avdm/sequence.py |
The subset is a single observed or planned shot: Asset, Shot with camera moves,
Entity, Event, AudioCue, Observation, exact rational TimeRanges, and per-aspect
coverage. 0.2 adds attribute claims on entities and on the shot, from a controlled
vocabulary, where unclear is always an answer and never a default. When a claim is
specified, the serializers write the picture from the claims, not from free prose. 0.3 gives
each entity a kind (person, character, animal, vehicle, structure, object or group), a
depiction (live, on screen, printed, drawn or animated, or sculpted) and, for most kinds, a
class. The kind decides which claims the entity can have. Intent,
constraints, baselines, bindings and edits come later.
0.3.2 adds two things (issues avdm#3 and avdm#4):
- The style of the picture.
styleis a closed shot claim (photograph,home video,film,animation,illustration,painting,render), andstyle_detailis free words ("watercolour", "1980s").unclearstays the only none-value. The caller's style is explicit (a human method); the observer's is observed. When both are present and differ,assemble()keeps the explicit claim and the superseded observation records the difference. - Known entities. The caller names each subject: a
KnownEntityholds a kind (one of the seven kinds), a name, a class word and a short description, with an optionaltrigger.frame_claims_form(known_entities=)asks the observer which known name each listed entity is, from a closed list, orunclear.apply_frame_claims(..., known_entities=)binds the answer toEntity.known_name; the name stays apart from the class the observer sees, and a difference between the caller's class and the observed one is recorded as two claims. The renderers takename_mode:"name"writes "Bob, a man, is at left. Bob wears a red robe.","trigger"writes the trigger in the name's place (a trigger is written exactly as given, so the name and the trigger versions of one caption differ in one place, which is the LoRA pair for differential output preservation), and"class"renders as a document with no names.validate()rejects an unknown name, a kind mismatch and two known entities with one name.
If you render the observer form for a model, take 0.3.3 before you take these
terms: 0.3.2 made the two style fields required in the form, which failed every
answer from a form without them (found by curu-vision), so 0.3.2 is yanked on
PyPI and 0.3.3 makes them optional, like gaze and facial_hair. A field left
out makes no claim, and answers from the 0.3.1 and 0.3.2 forms both validate.
Bump your form version when you first show the style fields to a model. Take
0.3.4 for the style flow itself: it fixes issue avdm#12, where the caller's
claim and the model's answer together left a document that validate()
rejected, and assemble() now removes the loser claim and records what it
claimed on the loser observation's limitations.
0.4.0 takes the style terms and one more known-entity step for curu-vision
(issue avdm#14). Its documents stay additive: avdm_version stays "0.3", and
the 0.4.0 number exists for the two form changes a consumer's model sees, so
every released consumer pin refuses it and the consumer takes it on purpose. A
known person or animal may play a named character ("Bob as John Wick"
in the name mode, at the first mention only); a known entity may hold a
reference (a page url, or a local picture's SHA-256 fingerprint in
asset_ref, never its path or its bytes); a binding records
binding_basis (model, face, face-and-model) and a separate confirmed
boolean, and a machine proposes and the owner confirms. Each style value now
carries its meaning, which the form shows to the observer. Bump your form
version for both form changes; the CHANGELOG names them.
0.5.0 splits style into three one-question terms (issue avdm#16, curu-vision
spec 027). On a video frame a model cannot tell a film from a photograph from
the pixels, and the mixed list let a judge judge quality by mistake. medium
says how the picture was made (moving pictures covers any camera video),
production says who made it and is never about quality, and genre says what
the whole work is — never a frame answer, always from the caller, the metadata
or a whole-video summary. style is deprecated: it stays a valid claim name
and stored documents keep rendering, but no model is asked for it again.
avdm_version stays "0.3", and the documents of 0.4.0 stay valid. Bump your
form version for the form change: style leaves the form and medium and
production join it.
0.5.1 gives a known entity a stable key, id: a UUID that the consumer mints
once (curu-catalog mints UUIDv7), never changed, never reused and never derived
from a name. Names change and repeat, so plays may now name the character's
id; when plays is the id of a known entity of the document it names that
entity, else the known entity with that name. validate() refuses two known
entities with one id. No caption and no form holds an id. The field is optional,
the documents of 0.5.0 stay valid, avdm_version stays "0.3", and the form a
model sees does not change, so no consumer changes a pin or a form version.
Use
import avdm
doc = avdm.assemble(avdm.SceneDocument.model_validate_json(raw)) # apply evidence rules
assert not avdm.validate(doc)
caption = avdm.to_h3(doc, trigger="ohwx")
The annotation record (0.6.0)
0.6.0 adds AnnotationRecord: one shape on one asset, beside the document. The
shape is a tag, a box, a polygon, a mask, a point set or a track. The record
also holds the label, the time, the source and the provenance of the shape.
Validate a record against avdm.record_schema(); the schema file holds the
record as a definition of its own. avdm_version stays "0.3", and a document
of 0.5.1 stays valid. AGENTS.md (section 2c) gives every rule.
import avdm
record = avdm.AnnotationRecord.model_validate_json("""
{
"avdm_version": "0.3",
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"asset": "sha256:0b1c2d3e4f5061728394a5b6c7d8e9f00b1c2d3e4f5061728394a5b6c7d8e9f0",
"media": "image",
"size": {"width": 5, "height": 4},
"shape": {"type": "mask", "counts": "52207"},
"label": {"term": "object:cup"},
"source": "import",
"imported_from": {
"format": "coco",
"file": "sha256:aa00bb11cc22dd33ee44ff5566778899aa00bb11cc22dd33ee44ff5566778899",
"position": 0
},
"attributes": {"team.reviewed": true}
}
""")
assert avdm.rle_decode(record.shape.counts) == [5, 2, 2, 2, 9]
- No names, no pictures. A label never holds a name. A record of a person
names a known entity by its UUID only, in
known_entity. A record has no field for a picture, a path or a vector. - The attributes are an open map. A key matches
^[a-z][a-z0-9_.-]{0,63}$, and a value is a text of at most 256 characters, a finite number or a boolean. The keyscandidate_entity,candidate_nameandunsureare reserved. - Warning: avdm cannot find a name in a free text. Do not put a private name or identity data in an attribute. curu-catalog applies its identity rules to each stored record.
- The coordinates are pixels of the upright decoded picture: after the EXIF
orientation of an image, and after the display rotation and the sample aspect
ratio of a video frame.
sizeis the full size of that picture. The origin is the top-left corner of the top-left pixel,xgoes right andygoes down. A box includes its left and top edges and excludes its right and bottom edges, so the top-left pixel is(0, 0, 1, 1). A mask is the compressed COCO run-length text, column-major, over the whole picture. - The time of a video shape is one source frame:
frame.ptsin integer ticks of the stream's time base, signed, with an optionalframe.indexfrom 0. - No serializer renders a record, so no caption holds its attributes or its ids.
Time, sequences and generation lineage (0.7.0)
- Evidence per fragment. Motion needs pictures: continuous audio does not
carry a camera move (avdm#21). Each attribute claim, event and audio cue needs
an observation of its own aspect about it; a supported sibling cue does not
carry an unsupported one, and no renderer writes an unsupported fragment
(
avdm.unsupported(), avdm#22). - A planned shot in time.
Entity.presence, a claim'srangeand a camera move'srangesay when things apply.to_h3(doc, timeline=True)renders the shot moment by moment, so a subject never appears before its entrance; a timed document withouttimeline=TrueraisesUnsupportedProjectionError.to_ste(doc, at=4)gives the claims of the frame at 4 s. ASceneSequenceorders single-shot documents (avdm#23). - Generation lineage. A
GenerationRecordholds one attempt: the exact input revisions in their order, their purposes, the slot and control used, the preparation and the bytes sent, what the backend reported, the prompt revision and the outputs.avdm.lineage_errors()checks that a set of records is acyclic (avdm#24).
AGENTS.md (sections 2, 2d and 2e) gives every rule.
Personas (0.8.0)
A persona is a look that a character holds: Robert Downey Jr. plays Tony Stark,
and Iron Man is the persona. A known entity of the kind persona names the
characters that hold it (persona_of), whether its face is human (face) and
a qualifier for two personas of one name. An entity binds it with persona,
and the caption reads "Robert Downey Jr. as Tony Stark (Iron Man), a man, is at
left." The form asks for a persona only when the caller offers one. AGENTS.md
(section 2b, item 10) gives every rule.
Appearance details (0.9.0)
A person has apparent_age, build and skin_tone, and every kind has detail:
a visible detail that no other term holds, such as "small scar on the left cheek".
An owner may hold several details; a detail that repeats a typed claim is
refused. persistence says whether a claim's range is when a stable feature is in
view or when a transient state holds. avdm.adoption_errors() checks a planned
claim adopted from an observation against its observed source. AGENTS.md (§2a,
§2d) gives every rule.
Develop
uv sync
uv run pytest
uv run ruff check . && uv run ruff format --check . && uv run ty check
To adopt AVDM in another repository, point that repository's agent at AGENTS.md.
Metadata
Release files for avdm 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| avdm-0.9.0.tar.gz | 176.8 kB | With provenance | Details for avdm-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| avdm-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for avdm-0.9.0-py3-none-any.whl |
Total release size: 252.7 kB
Release files / avdm-0.9.0.tar.gz
| Download URL | avdm-0.9.0.tar.gz |
|---|---|
| Size | 176.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cbf051f517098e69f4d6ec2da84a559a95c8095251f56848698d9e15ef99daed
|
|
BLAKE2b-256 checksum How to use checksums |
198c3570a336ce201c9ee215a5cd1666d2441479a51b6bcf7ca0b2d6a6eb0171
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / avdm-0.9.0-py3-none-any.whl
| Download URL | avdm-0.9.0-py3-none-any.whl |
|---|---|
| Size | 76.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8ed821e8129d5e29f0bd1db5156f82da03eee2ecd200fdde22ad82c9e0c8d63
|
|
BLAKE2b-256 checksum How to use checksums |
09178b1d835c8c4a156b1a925a9d5c105c6119d83cf6b66189846fa97a4c9c10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for avdm 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for avdm-0.9.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.