Skip to content

Commit 31e49ed

Browse files
committed
feat: increase chunk size for face embedding processing to improve performance and increased the resolution for better accuracy
1 parent 7ce4b94 commit 31e49ed

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

inference_api/infrastructure/di_container.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Container(containers.DeclarativeContainer):
1515
face_detector = providers.Singleton(
1616
FaceDetector,
1717
model_path="models/buffalo_l/det_10g.onnx",
18+
input_size=(1920, 1920),
1819
device="cuda",
1920
num_threads=1,
2021
)

inference_api/infrastructure/onnx/embedder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def embed_batch(self, aligned_faces: list[np.ndarray]) -> np.ndarray:
128128
return np.empty((0, 512), dtype=np.float32)
129129

130130
# Process in chunks to avoid OOM
131-
chunk_size = 32
131+
chunk_size = 256
132132
embeddings_list = []
133133

134134
for i in range(0, len(aligned_faces), chunk_size):

0 commit comments

Comments
 (0)