Spaces:
Running
Running
Commit
·
bdf6b1f
1
Parent(s):
83dac54
Updated utils.py
Browse files
utils.py
CHANGED
@@ -4,6 +4,7 @@ from ultralight.utils import draw_faces
|
|
4 |
import time
|
5 |
import os
|
6 |
import asyncio
|
|
|
7 |
|
8 |
def load_caffe_models():
|
9 |
models_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "opencv_models")
|
@@ -44,8 +45,8 @@ async def detect_faces_frame(detector, frame=None):
|
|
44 |
y1_pad = max(0, y1 - padding_y)
|
45 |
x2_pad = min(width, x2 + padding_x)
|
46 |
y2_pad = min(height, y2 + padding_y)
|
47 |
-
box = (x1_pad, y1_pad, x2_pad, y2_pad)
|
48 |
|
|
|
49 |
face_img = frame[y1_pad:y2_pad, x1_pad:x2_pad]
|
50 |
|
51 |
if face_img.shape[0] < 10 or face_img.shape[1] < 10:
|
|
|
4 |
import time
|
5 |
import os
|
6 |
import asyncio
|
7 |
+
import numpy as np
|
8 |
|
9 |
def load_caffe_models():
|
10 |
models_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "opencv_models")
|
|
|
45 |
y1_pad = max(0, y1 - padding_y)
|
46 |
x2_pad = min(width, x2 + padding_x)
|
47 |
y2_pad = min(height, y2 + padding_y)
|
|
|
48 |
|
49 |
+
box = np.array([x1_pad, y1_pad, x2_pad, y2_pad])
|
50 |
face_img = frame[y1_pad:y2_pad, x1_pad:x2_pad]
|
51 |
|
52 |
if face_img.shape[0] < 10 or face_img.shape[1] < 10:
|