Spaces:
Sleeping
Sleeping
Sync from GitHub via hub-sync
Browse files
README.md
CHANGED
|
@@ -13,6 +13,7 @@ license: mit
|
|
| 13 |

|
| 14 |

|
| 15 |

|
|
|
|
| 16 |
|
| 17 |
# Face Verification
|
| 18 |
|
|
|
|
| 13 |

|
| 14 |

|
| 15 |

|
| 16 |
+

|
| 17 |
|
| 18 |
# Face Verification
|
| 19 |
|
src/faceverification/interfaces/fastapi_app.py
CHANGED
|
@@ -410,7 +410,7 @@ async def verify_identity(
|
|
| 410 |
def main() -> None:
|
| 411 |
import uvicorn
|
| 412 |
|
| 413 |
-
uvicorn.run("faceverification.interfaces.fastapi_app:app",
|
| 414 |
|
| 415 |
|
| 416 |
if __name__ == "__main__":
|
|
|
|
| 410 |
def main() -> None:
|
| 411 |
import uvicorn
|
| 412 |
|
| 413 |
+
uvicorn.run("faceverification.interfaces.fastapi_app:app", port=8000)
|
| 414 |
|
| 415 |
|
| 416 |
if __name__ == "__main__":
|
src/faceverification/interfaces/gradio_app.py
CHANGED
|
@@ -25,7 +25,7 @@ def verify_person_ui(image: Image.Image | None) -> tuple[str, Image.Image]:
|
|
| 25 |
raise gr.Error("Upload an image before verifying an identity.")
|
| 26 |
|
| 27 |
name, annotated_image = verify_person(image)
|
| 28 |
-
return
|
| 29 |
except FaceNotDetectedError as exc:
|
| 30 |
raise gr.Error(str(exc)) from exc
|
| 31 |
except Exception as exc:
|
|
@@ -83,7 +83,7 @@ with (
|
|
| 83 |
<h1>Face Verification Demo</h1>
|
| 84 |
<p>
|
| 85 |
Register a known face, then upload another image to check whether it
|
| 86 |
-
matches an identity stored in the
|
| 87 |
</p>
|
| 88 |
</div>
|
| 89 |
"""
|
|
@@ -92,7 +92,7 @@ with (
|
|
| 92 |
gr.HTML(
|
| 93 |
"""
|
| 94 |
<span class="hint">
|
| 95 |
-
Use clear, front-facing photos with one visible face. The demo stores
|
| 96 |
only for this running session, so the database may reset when the Space restarts.
|
| 97 |
</span>
|
| 98 |
"""
|
|
@@ -109,7 +109,7 @@ only for this running session, so the database may reset when the Space restarts
|
|
| 109 |
)
|
| 110 |
input_name = gr.Textbox(
|
| 111 |
label="Person name",
|
| 112 |
-
placeholder="Example:
|
| 113 |
)
|
| 114 |
submit_btn = gr.Button(
|
| 115 |
"Add person to database",
|
|
@@ -168,7 +168,6 @@ If a face is detected, the annotated image confirms what face was stored.
|
|
| 168 |
|
| 169 |
def main():
|
| 170 |
FV_gr.launch(
|
| 171 |
-
server_name="0.0.0.0",
|
| 172 |
server_port=7860,
|
| 173 |
theme=APP_THEME,
|
| 174 |
css=APP_CSS,
|
|
|
|
| 25 |
raise gr.Error("Upload an image before verifying an identity.")
|
| 26 |
|
| 27 |
name, annotated_image = verify_person(image)
|
| 28 |
+
return name, annotated_image
|
| 29 |
except FaceNotDetectedError as exc:
|
| 30 |
raise gr.Error(str(exc)) from exc
|
| 31 |
except Exception as exc:
|
|
|
|
| 83 |
<h1>Face Verification Demo</h1>
|
| 84 |
<p>
|
| 85 |
Register a known face, then upload another image to check whether it
|
| 86 |
+
matches an identity stored in the database.
|
| 87 |
</p>
|
| 88 |
</div>
|
| 89 |
"""
|
|
|
|
| 92 |
gr.HTML(
|
| 93 |
"""
|
| 94 |
<span class="hint">
|
| 95 |
+
Use clear, front-facing photos with one visible face. The demo stores data
|
| 96 |
only for this running session, so the database may reset when the Space restarts.
|
| 97 |
</span>
|
| 98 |
"""
|
|
|
|
| 109 |
)
|
| 110 |
input_name = gr.Textbox(
|
| 111 |
label="Person name",
|
| 112 |
+
placeholder="Example: John Doe",
|
| 113 |
)
|
| 114 |
submit_btn = gr.Button(
|
| 115 |
"Add person to database",
|
|
|
|
| 168 |
|
| 169 |
def main():
|
| 170 |
FV_gr.launch(
|
|
|
|
| 171 |
server_port=7860,
|
| 172 |
theme=APP_THEME,
|
| 173 |
css=APP_CSS,
|