BUG: Installing Semantic Search after videos are indexed skips video frame embedding and semantic scoring backfill
Maintainers usually reply within 3 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Read backend/app/routes/models.py and the existing backfill tests in backend/tests/test_models.py; compare the model installation flow with the folder sync flow described in the issue. The issue identifies the missing video processing and scoring tasks, and done means installing the semantic tier backfills previously indexed videos as well as images. Pull request #1801 is already open for this issue.
Written by the indexing model from the issue text.
Description
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
- On initial setup/AI tagging,
ensure_ai_tagging_models()(backend/app/utils/model_bootstrap.py:22-30) installs the preferred YOLO tier +facenet, not thesemantictier (siglip2_base_vision,siglip2_base_text,siglip2_base_tokenizer). - User adds/syncs a folder containing photos and videos (
post_sync_folder_sequenceinbackend/app/routes/folders.py:209-242orpost_ai_tagging_sequenceat180-199):video_util_process_untagged_videos()extracts keyframes intovideo_frames(defaultisEmbedded = 0inbackend/app/database/video_frames.py:37).video_util_process_unembedded_frames()(backend/app/utils/videos.py:1120-1124) skips embedding becauseSigLIP2_Base_Vision.onnxis not installed yet ("SigLIP2 vision model not installed; skipping frame embedding pass").
- Later, user opens Settings -> AI Models -> Available and installs the Semantic Search tier (
POST /models/setupwithtier="semantic", orPOST /models/download/siglip2_base_vision). submit_embedding_backfill_if_semantic()(backend/app/routes/models.py:40-59) runs for images only.- 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) andpost_sync_folder_sequence(backend/app/routes/folders.py:240-241),submit_embedding_backfill_if_semantic()never submitsvideo_util_process_unembedded_frames(backend/app/utils/videos.py:1096, whose own docstring describes it as "the video counterpart ofimage_util_process_unembedded_images") orsemantic_util_score_videos(backend/app/utils/semantic_labels.py:253). - App startup in
backend/main.py:115-117submitssemantic_util_build_label_embeddings,semantic_util_score_images, andsemantic_util_score_videos, but also does not runvideo_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 whenSigLIP2_Base_Vision.onnxis 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
- Dominant language
- Python
- Stars
- 322
- Forks
- 793
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/PictoPy
-
bug enhancement
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AOSSIE-Org/PictoPy#1802 · 2 comments ·
Maintainers usually reply within 3 days
-
BUG: XMP metadata export permanently overwrites file modification timestamp (mtime), destroying photo datesPossibly taken @swastiksharma45 claimed this 2 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/PictoPy#1788 · 6 comments ·
Maintainers usually reply within 3 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
AOSSIE-Org/PictoPy#1786 · 1 comment ·
Maintainers usually reply within 3 days
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)Possibly taken @omkar-suryavanshi claimed this 3 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/PictoPy#1780 · 5 comments ·
Maintainers usually reply within 3 days
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't workPossibly taken @ManyaJain111 claimed this 2 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/PictoPy#1779 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
All issues in AOSSIE-Org/PictoPy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Possibly taken @cestercian claimed this today. Opencomp/cli P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#162259 · 1 comment ·
Maintainers usually reply within 1 day
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
conan-io/conan-center-index#31597 ·
Maintainers usually reply within 1 day
-
community-request
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA-NeMo/Run#727 ·
Maintainers usually reply within 1 day
-
bot-triaged module: higher order operators module: pickle module: pt2-dispatcher oncall: pt2 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
pytorch/pytorch#207247 · 1 comment ·
Maintainers usually reply within 1 day