Automatic captions can repeat another camera’s description or save the example tag “lowercase” as event text

Open Beginner friendly
#155 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
ollama, python

Research direction

Start with parse_vision_output in src/keystone/vlm.py at the linked commit, then find the callers that build and persist VisionResult.description. Exercise the parser directly with {"description":"","tags":["lowercase"]} to reproduce the placeholder fallback, and inspect the related-sightings hint path for the copied-description case. Done means placeholder output is not accepted as a successful caption, conflicting cross-camera context cannot be copied as the current description, and regression cases preserve valid descriptions.

Written by the indexing model from the issue text.

Description

An automatic event caption repeated an unrelated camera's description verbatim. This was a successful inference and callback, separate from the on-demand timeout in #151.

Environment

Keystone 0.1.6, Docker Compose on Linux, Intel i5-6400T with 16 GB RAM, local Ollama with qwen3.5:2b-q4_K_M, three frames in strip layout, Protect 7.3.74. The deployment has a local patch that skips automatic captions on two cameras. The affected camera had captions enabled. The controlled tests below call the vision client directly and bypass the patched worker queue.

Same-frame reproduction
  1. Take three chronological frames from one recording. Keep the frames, offsets, model and prompt settings fixed. Run VisionClient.describe with no cross-camera hint.
  2. Repeat with a hint reconstructed from the cross-camera matches logged during the event, using Keystone's own related-sightings formatter. The hint describes a visibly different scene.
  3. With no hint, the resulting description was the literal string lowercase. With the hint, it returned the other scene's entire sentence word for word. On the live system, substantially the same sentence appeared in seven caption records across three camera IDs within about four minutes.

I expected a caption supported by the current frames, or an explicit result indicating that the model couldn't describe them. Keystone accepted both the placeholder and the copied sentence as captions. The word lowercase appears as an example tag in the default prompt.

This replay isolates the effect of passing the hint. It uses frames from the recorded interval and reconstructed hint text, rather than a saved copy of the original model request. The timing fix in #129 is relevant to choosing frames, but this test held the image bytes fixed between calls.

Check against current main

I also tested the upstream vlm.py at 0ea0a097b645a41af03f4a2f1756464c72d62875 against the same local Ollama model, with the default English behavior. This was a vision-client comparison, not a full Protect deployment of main. I compared the stock prompt with a shorter custom prompt, omitted cross-camera hints in both arms, and kept the three frames identical within each pair.

  • On an indoor clip, three motion-centered, upright crops clearly showed a person walking. Stock returned lowercase again. The shorter prompt described the visible clothing and movement correctly.
  • On two outdoor clips from different cameras, both prompts recognized the person and reflective clothing, but both gave the wrong direction of travel. A shorter global prompt isn't a proven fix.

I traced the raw model output on the reproduced indoor case: the description field was an empty string and tags was ["lowercase"]. The final VisionResult.description was "lowercase". This narrows one failure to the empty-description tag fallback in parse_vision_output. Maintainers can exercise this part without a model or video by passing {"description":"","tags":["lowercase"]} as JSON text to that parser.

The custom prompt was: “Write one short factual event caption. Describe the visible subject, clothing and movement across the frames. Omit details you cannot see. Return JSON with description and tags.”

Could the caption pipeline detect placeholder output and avoid saving it as a successful description? For the cross-camera case, it would also help to test a clip with a deliberately conflicting previous description, while retaining cases where cross-camera context correctly clarifies a subject.

Dominant language
Python
Stars
1k
Forks
114
Avg merge
1h
Merged PRs (30d)
115

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from seeARMS/keystone

All issues in seeARMS/keystone

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.