Use fixed Pets model Release and idle-start recognition - #917
Draft
OliverZhaohaibin wants to merge 37 commits into
Draft
Use fixed Pets model Release and idle-start recognition#917OliverZhaohaibin wants to merge 37 commits into
OliverZhaohaibin wants to merge 37 commits into
Conversation
OliverZhaohaibin
force-pushed
the
fix-pets-first-use-model-acquisition-v2
branch
from
August 22, 2026 19:37
bb6cf5d to
992b4ea
Compare
OliverZhaohaibin
force-pushed
the
fix-pets-first-use-model-acquisition-v2
branch
from
August 22, 2026 22:34
b9f88bd to
d94bcbb
Compare
OliverZhaohaibin
had a problem deploying
to
pets-model-release
August 25, 2026 04:04 — with
GitHub Actions
Failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces production-side DINOv2 source execution and user-side tracing
with one fixed project Release artifact, makes both Pets model acquisitions
self-healing and permission-safe, and intentionally starts People/Pets after a
successful startup metadata scan plus 1500 ms of application inactivity.
Runtime model contract
pet-models-v1/dinov2_vits14.pt; it never invokesTorch Hub, downloads DINO source/checkpoint, imports xFormers, or traces a
model on the user's machine.
commit/tree, official checkpoint, and
torch==2.12.1producer contract.IPHOTO_PET_MODEL_DIRis authoritative for lookup and repair. Corrupt YOLOXand legacy/invalid DINO caches are repaired in place under a cross-process
acquisition lock; disabled downloads preserve the invalid file and fail
explicitly. Only
EACCES,EPERM, andEROFScan trigger storage fallback.builder commit
ceb24fa011faa78928e4fb93426273c9f64a9358.The public model is pinned at SHA-256
7f8e204c6222662ee53ef61fb02b1278781e0ab70a57fa73a63cdef9ed32ab13and 88,566,102 bytes.
workflow requires an artifact run ID, verifies the run API/workflow/repository,
builder checkout and build manifest, targets the artifact head SHA, and
refuses to overwrite the now-frozen v1 Release.
Intentional recognition startup policy
After startup metadata succeeds, input inactivity arms a 1500 ms timer and
starts closed-input Face/Pet workers at
LowestPriority. Click, wheel, key,drag, touch, gesture, owned menus, modal dialogs and transient popups reset the
timer. Rebind, cancellation, scan failure and shutdown invalidate it.
Opening People while the metadata scan is active no longer starts workers early.
cv2process-global initialization is serialized before a Face QThread starts,preventing the observed macOS libshiboken
KeyError: cv2.Errorfatal exit.The same-commit benchmark switch
IPHOTO_STARTUP_RECOGNITION_AUTO_START=0disables only automatic startup forcontrolled A/B; explicit feature activation remains available.
Performance evidence
See
PR917_RECOGNITION_IDLE_BENCHMARK.md.alternating 10-pair A/B used a disposable five-image template restored before
every run.
P50/P95
-0.09%/-0.63%; first usable thumbnail-0.06%/-2.77%.0 msin all 30 auto samples.8510/8786 ms, RSS P50/P951395/1469 MiBon macOS arm64 source runtime.diagnostics. Missing Pets model/download-disabled: 5/5 graceful runs.
contract. Packaged Windows/Linux/macOS Intel resource figures remain manual.
Validation
3233 passed, 21 skipped.identical artifact loading on Ubuntu, macOS and Windows.
TLS/hash/size path and performs
jit.loadplus fixed-shape inference.YOLOX, Pets 50k, and 384-dimensional production-shape contracts.