anasazasaa commited on
Commit
fc0495d
·
verified ·
1 Parent(s): e4f0308

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -43,7 +43,7 @@ def load_image(path):
43
  size = max(h_orig, w_orig)
44
  scale = 640 / size
45
  w, h = int(w_orig * scale), int(h_orig * scale)
46
- image = cv2.resize(image, (w, h))
47
  return image
48
 
49
 
@@ -67,8 +67,8 @@ def draw_label(image,
67
 
68
 
69
  @torch.inference_mode()
70
- def predict(image, model, face_detector, device, margin=0.4, input_size=224):
71
- image = cv2.imread(image, cv2.IMREAD_COLOR)[:, :, ::-1].copy()
72
  image_h, image_w = image.shape[:2]
73
 
74
  # detect faces using dlib detector
 
43
  size = max(h_orig, w_orig)
44
  scale = 640 / size
45
  w, h = int(w_orig * scale), int(h_orig * scale)
46
+ image = cv2.imread(path)
47
  return image
48
 
49
 
 
67
 
68
 
69
  @torch.inference_mode()
70
+ def predict(image_path, model, face_detector, device, margin=0.4, input_size=224):
71
+ image = load_image(image_path)
72
  image_h, image_w = image.shape[:2]
73
 
74
  # detect faces using dlib detector