fix: address 2 code review findings (round 9)
- executor: revert person_has_fscores=True back into try/except else branch; moving it outside in round 8 was a regression — when the tracker write fails on the first-ever upload (no prior frigate_scores in tracker), setting the flag True prematurely switches at-cap replacement into fscore mode, get_most_redundant_mapped_file returns None (no entries), and all replacements are silently skipped; the flag must only be set when the score is actually written - diversity: remove dead face_crop-None guard; any face that passes assess_quality (≥90 px MIN_FACE_WIDTH) produces a crop ≥135 px (face + 25% margin), which is always above the 30 px crop minimum, making the guard unreachable; _crop_face_from_thumbnail also calls _get_face_bbox internally, so face_bbox is not None guarantees the inner bbox check also passes
This commit is contained in:
@@ -299,13 +299,6 @@ def _select_by_embedding(
|
||||
|
||||
asset["quality_score"] = quality.blur_score
|
||||
face_crop = _crop_face_from_thumbnail(img, asset, person_id=person_id)
|
||||
if face_crop is None and face_bbox is not None:
|
||||
logger.warning(
|
||||
"Face too small to crop for %s — skipping to avoid embedding wrong person",
|
||||
asset["id"],
|
||||
)
|
||||
quality_filtered += 1
|
||||
continue
|
||||
embed_img = face_crop if face_crop is not None else img
|
||||
|
||||
emb = get_embedding(embed_img, asset_id=asset["id"])
|
||||
|
||||
@@ -534,6 +534,7 @@ def upload_to_frigate(jobs: list[dict]) -> None:
|
||||
" but asset may be re-selected next run: %s",
|
||||
fname, tracker_exc,
|
||||
)
|
||||
else:
|
||||
if pre_fscore is not None:
|
||||
person_has_fscores = True
|
||||
# Always record for reconcile so the Frigate filename→asset_id
|
||||
|
||||
Reference in New Issue
Block a user