Skip to content

Commit

Permalink
finished README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AtticusZeller committed Apr 12, 2024
1 parent a857756 commit 5d884c7
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 18 deletions.
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# 🚀 BoostFace 🚀

Welcome to **BoostFace**! The cutting-edge, high-performance face recognition system designed to revolutionize the way we think about real-time identification and tracking. Built with a powerful stack of technologies, BoostFace is your go-to solution for handling high-load, high-concurrency scenarios with ease and efficiency. 🌟

## Demo
![img.png](assets/img.png)
## 🛠 Tech Stack

- **Frontend**: Leveraging [Streamlit](https://streamlit.io/) for an intuitive, user-friendly interface, combined with SCRFD for efficient and accurate face detection, and SORT for multi-object tracking. Real-time image transmission is facilitated through Websockets, ensuring a seamless and dynamic user experience. 🖥️
Expand All @@ -27,16 +28,40 @@ git clone https://github.com/Atticuszz/boostface.git
cd boostface
```

### prepare
- download arcface_onnx model
```bash
cd src/Demo/backend/services/inference/model_zoo
wget https://github.com/Atticuszz/BoostFace/releases/download/dataset/models.zip
unzip models.zip
rm -rf models.zip
```

- install env
- init env
```bash
cd src/Demo
conda env create -f environment.yml
conda activate BoostFace-demo
```
- register demo face after backend start
```bash
# register demo
python src/Demo/web/inference/utils/register.py
```

### run

- start vector database
```bash
docker-compose up src/Demo/backend/services/db/milvus-standalone-docker-compose.yml
```

- start backend
```bash
# run backend
python src/Demo/backend/main.py
```

- start web
```bash
streamlit run src/Demo/web/main.py
```
Binary file added assets/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/face_track_dateset.pdf
Binary file not shown.
Empty file removed doc/paper.docx
Empty file.
Binary file removed doc/scrfd.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion src/Demo/backend/common/web_socket_manager.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from contextlib import asynccontextmanager

from backend.core.config import logger
from fastapi import WebSocket
from pydantic import BaseModel
from starlette.websockets import WebSocketState

from ..core.config import logger


class WebSocketManager:
"""WebSocket manager"""
Expand Down
5 changes: 3 additions & 2 deletions src/Demo/backend/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import subprocess

import uvicorn
from backend.core.events import lifespan
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from pygizmokit.rich_logger import set_up_logging

from src.Demo.backend.core.events import lifespan

set_up_logging()


Expand All @@ -22,7 +23,7 @@ def create_app() -> FastAPI:
)

# Include the routers
from backend.api import auth_router, identify_router
from src.Demo.backend.api import auth_router, identify_router

app.include_router(auth_router)
app.include_router(identify_router)
Expand Down
4 changes: 0 additions & 4 deletions src/Demo/backend/services/db/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def __init__(self, threshold=0.5):
self._client.collection.load(timeout=10)
utility.wait_for_loading_complete(self._client.collection.name, timeout=10)

# @profile
def search(self, embedding: Embedding) -> MatchedResult:
"""
:param embedding: must be normed
Expand All @@ -53,9 +52,6 @@ def stop_client(self):
self._client.shut_down()


# TODO: register if the operation is registered instead of identify


class Registrar:
def __init__(self):
self._client = MilvusClient()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Demo/web/data/image/Friends/simple/joey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/Demo/web/data/image/Friends/simple/monica.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Demo/web/data/image/Friends/simple/ross.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 5 additions & 8 deletions src/Demo/web/inference/utils/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
from pathlib import Path

import cv2
from web.inference.common import ImageFaces
from web.inference.component.detector import Detector
from web.settings import DetectorConfig

IMAGE_PATH = r"/home/atticuszz/DevSpace/python/BoostFace/src/boostface/dataset_loader/data/lfw-deepfunneled/lfw-deepfunneled"
# IMAGE_PATH = (
# "/home/atticuszz/DevSpace/python/BoostFace/src/Demo/web/data/image/Friends/simple"
# )
# paper: 高并发注册人脸
from src.Demo.web.inference.common import ImageFaces
from src.Demo.web.inference.component.detector import Detector
from src.Demo.web.inference.settings import DetectorConfig

IMAGE_PATH = Path(__file__).parents[2] / r"data/image/Friends/simple"

import asyncio

Expand Down

0 comments on commit 5d884c7

Please sign in to comment.