Minor: type annotation, getattr cleanup, error message clarity in _load_detector #11
Labels
No labels
blocked:needs-attention
blocked:needs-decision
blocked:needs-decompose
blocked:needs-design
blocked:needs-triage
blocked:preflight
blocked:unclassified
bug
documentation
enhancement
gsd-spec
in-progress
lint-cleanup
needs-decompose
priority:high
priority:low
priority:medium
quickfix
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/kimi_agent_local_ai_image_enhancer#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two minor issues in the new
_load_detector()helper (face_swapper.py:217):-> Optional["SCRFDDetector"].getattrfor an attribute that's always set in__init__. Line 226 usesgetattr(self, '_detector', None)even thoughself._detector = Noneis on line 54. Inconsistent with_officialaccess.Also: Error message on line 129 is technically accurate but misleading for users who only call
infer_with_embedding()(which doesn't need SCRFD). Consider clarifying.Fix: Add type annotation. Replace
getattr(self, '_detector', None)withself._detector. Tighten the error message to mention that this error is specific toinfer(), notinfer_with_embedding().Files to modify:
auraframe/models/face_swapper.pylines 217-235Test: Lint clean. Existing tests pass.