Skip to content

Commit

Permalink
Add img client
Browse files Browse the repository at this point in the history
  • Loading branch information
iitzco committed Aug 15, 2018
1 parent e81092c commit 9d7c06d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions img_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import cv2
import sys
import time

from detector import FaceDetector
from utils import annotate_image

YOLO_MODELS_DIR = "/Users/ivanitz/Projects/yolo-face-artifacts/run6/models/"
CORRECTOR_MODELS_DIR = "/Users/ivanitz/Projects/fine-tuned-face/models/"


def run(img_path):
face_detector = FaceDetector(YOLO_MODELS_DIR, CORRECTOR_MODELS_DIR)

img = cv2.imread(img_path)

now = time.time()
bboxes = face_detector.predict(img)
print("FPS: {:0.2f}".format(1 / (time.time() - now)))
ann_img = annotate_image(img, bboxes)

cv2.namedWindow('image', cv2.WINDOW_NORMAL)
cv2.imshow('image',ann_img)
cv2.waitKey(0)
cv2.destroyAllWindows()


if __name__ == "__main__":
img_path = sys.argv[1]
run(img_path)
Binary file added imgs/test.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9d7c06d

Please sign in to comment.