Skip to content

BUG: Installing Semantic Search after videos are indexed skips video frame embedding and semantic scoring backfill #1800

Backlog

Description

@neo0007777

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Summary

When a user indexes folders containing videos before installing the Semantic Search (semantic) model tier, later installing the semantic models only backfills image embeddings and image semantic scores — it never submits video_util_process_unembedded_frames or semantic_util_score_videos.

As a result, every video indexed prior to installing Semantic Search remains permanently unembedded (video_frames.isEmbedded = 0, zero rows in video_frame_embeddings, zero semantic tags in video_classes), and GET /videos/semantic-search omits all of those videos (or returns "No video frames have been embedded yet."). Even restarting the app does not fix it.


How Users Hit This

  1. On initial setup/AI tagging, ensure_ai_tagging_models() (backend/app/utils/model_bootstrap.py:22-30) installs the preferred YOLO tier + facenet, not the semantic tier (siglip2_base_vision, siglip2_base_text, siglip2_base_tokenizer).
  2. User adds/syncs a folder containing photos and videos (post_sync_folder_sequence in backend/app/routes/folders.py:209-242 or post_ai_tagging_sequence at 180-199):
    • video_util_process_untagged_videos() extracts keyframes into video_frames (default isEmbedded = 0 in backend/app/database/video_frames.py:37).
    • video_util_process_unembedded_frames() (backend/app/utils/videos.py:1120-1124) skips embedding because SigLIP2_Base_Vision.onnx is not installed yet ("SigLIP2 vision model not installed; skipping frame embedding pass").
  3. Later, user opens Settings -> AI Models -> Available and installs the Semantic Search tier (POST /models/setup with tier="semantic", or POST /models/download/siglip2_base_vision).
  4. submit_embedding_backfill_if_semantic() (backend/app/routes/models.py:40-59) runs for images only.
  5. After backfill completes, searching via GET /videos/semantic-search (backend/app/routes/videos.py:114-173) never finds the previously indexed videos until the user happens to trigger another folder sync or toggle AI tagging off/on.

Root Cause

In backend/app/routes/models.py:40-59:

def submit_embedding_backfill_if_semantic(
    model_keys: List[str], executor: ProcessPoolExecutor
) -> None:
    if any(
        MODEL_REGISTRY[key].get("feature") in SEMANTIC_FEATURES for key in model_keys
    ):
        executor.submit(semantic_util_build_label_embeddings)
        executor.submit(image_util_process_unembedded_images)
        executor.submit(semantic_util_score_images)
        executor.submit(xmp_export_if_enabled)
  • Unlike post_ai_tagging_sequence (backend/app/routes/folders.py:197-198) and post_sync_folder_sequence (backend/app/routes/folders.py:240-241), submit_embedding_backfill_if_semantic() never submits video_util_process_unembedded_frames (backend/app/utils/videos.py:1096, whose own docstring describes it as "the video counterpart of image_util_process_unembedded_images") or semantic_util_score_videos (backend/app/utils/semantic_labels.py:253).
  • App startup in backend/main.py:115-117 submits semantic_util_build_label_embeddings, semantic_util_score_images, and semantic_util_score_videos, but also does not run video_util_process_unembedded_frames, so restarting does not recover unembedded video keyframes either.

Expected Behavior

Installing a semantic model via POST /models/setup or POST /models/download/{model_key} should backfill both photos and videos:

  • video_util_process_unembedded_frames (already self-gating when SigLIP2_Base_Vision.onnx is missing)
  • semantic_util_score_videos (already self-gating when label embeddings aren't cached yet)

(Optionally, the Semantic Search Installed info dialog in frontend/src/pages/ModelManager/AvailableTab.tsx:226-237 could also mention photos and videos rather than only photos.)


Affected Files

  • backend/app/routes/models.py (submit_embedding_backfill_if_semantic, lines 40-59)
  • backend/tests/test_models.py (TestEmbeddingBackfillTrigger, lines 918-994)
  • backend/tests/test_metadata_export_pipeline.py (lines 89-102)

Record

  • I agree to follow this project's Code of Conduct

Activity

  1. github-actions commented on Nov 30, 2026

    @github-actions
    Contributor

    👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)

    Discussions are carried on Discord.

    Instead of commenting here, join the AOSSIE Discord server and go to Projects → PictoPy.

    If you find this project useful, a GitHub star would be appreciated.

  2. added
    bug
    on Nov 30, 2026
  3. gitcordapp commented on Dec 1, 2026

    @gitcordapp

    Link your account with Gitcord

    Thanks for opening this issue, @neo0007777!

    To receive Discord notifications and contributor tracking for this organization:

    1. Join Discord: https://discord.gg/hjUhu33uAn
    2. In Discord, run /link neo0007777
    3. Paste the verification code into your GitHub bio (or a public gist)
    4. Click Verify in Discord (or run /verify-link neo0007777)

    Once linked, Gitcord can notify you about assignments, mentions, and more.

    — Posted by Gitcord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions