Skip to content

Face Recognition Countdown Timer Doesn’t Reset When Accessories Are Detected #123

@SomdattaNag

Description

@SomdattaNag

In the SecuritySystem class, when YOLOv5 detects any accessories (e.g., mask, sunglasses, cap, scarf, etc.), the system displays a warning message and plays a voice alert, but the 10-second face recognition countdown timer is not reset.

As a result, when the person removes the accessory, the countdown resumes from where it left off instead of starting fresh.
This can cause incorrect scan completions or false security triggers.

Approach: Reset the timer and start it from the beginning once a face covering is detected.

Code snippet to be modified:
In the get_frame module:

accessories = self.detect_accessories(frame)
if accessories:
self.current_status = f"⚠️ Please remove: {', '.join(accessories).title()}"
speak_event("remove_accessory", f"Please remove: {', '.join(accessories)}")
self.status_color = '#ff0000'
return frame

Metadata

Metadata

Labels

gssoc25This issue and task is a part of GirlScript Summer of Code 25.level 1Easy level task

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions