Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -161,16 +161,22 @@ with gr.Blocks(title="SecureFace ID – Privacy-First Recognition") as demo:
|
|
| 161 |
gr.Markdown("# SecureFace ID")
|
| 162 |
gr.Markdown("**Every face is always blurred • Only authorized people are identified • Persistent tracking**")
|
| 163 |
|
| 164 |
-
|
|
|
|
| 165 |
with gr.Row():
|
| 166 |
-
|
| 167 |
-
|
|
|
|
|
|
|
| 168 |
with gr.Row():
|
| 169 |
blur_type = gr.Radio(["gaussian", "pixelate", "solid"], value="gaussian", label="Blur Style")
|
| 170 |
intensity = gr.Slider(10, 100, 40, label="Blur Intensity")
|
| 171 |
expand = gr.Slider(1.0, 2.0, 1.3, label="Blur Area Size")
|
| 172 |
show_labels = gr.Checkbox(True, label="Show Names / Unknown IDs")
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
| 174 |
|
| 175 |
with gr.Tab("Enroll New Person"):
|
| 176 |
gr.Markdown("### Add someone to the database")
|
|
|
|
| 161 |
gr.Markdown("# SecureFace ID")
|
| 162 |
gr.Markdown("**Every face is always blurred • Only authorized people are identified • Persistent tracking**")
|
| 163 |
|
| 164 |
+
with gr.Tab("Live Privacy Mode"):
|
| 165 |
+
gr.Markdown("### Real-time blurring + recognition")
|
| 166 |
with gr.Row():
|
| 167 |
+
inp_webcam = gr.Image(sources=["webcam"], streaming=True, label="Live Webcam", height=500)
|
| 168 |
+
inp_upload = gr.Image(sources=["upload"], label="Upload Image/Video", height=500)
|
| 169 |
+
out = gr.Image(label="Protected Output (faces blurred + IDs shown)", height=600)
|
| 170 |
+
|
| 171 |
with gr.Row():
|
| 172 |
blur_type = gr.Radio(["gaussian", "pixelate", "solid"], value="gaussian", label="Blur Style")
|
| 173 |
intensity = gr.Slider(10, 100, 40, label="Blur Intensity")
|
| 174 |
expand = gr.Slider(1.0, 2.0, 1.3, label="Blur Area Size")
|
| 175 |
show_labels = gr.Checkbox(True, label="Show Names / Unknown IDs")
|
| 176 |
+
|
| 177 |
+
# Connect both inputs to same function
|
| 178 |
+
inp_webcam.stream(process_frame, [inp_webcam, blur_type, intensity, expand, show_labels], out)
|
| 179 |
+
inp_upload.change(process_frame, [inp_upload, blur_type, intensity, expand, show_labels], out)
|
| 180 |
|
| 181 |
with gr.Tab("Enroll New Person"):
|
| 182 |
gr.Markdown("### Add someone to the database")
|