Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow detection #28

Closed
ninnnnnnr opened this issue Jan 28, 2022 · 4 comments
Closed

Slow detection #28

ninnnnnnr opened this issue Jan 28, 2022 · 4 comments
Labels
question Further information is requested

Comments

@ninnnnnnr
Copy link

Hello, very good recognition results! But very slow. My code:
`from retinaface import RetinaFace
import cv2
from datetime import datetime

start_time = datetime.now()

img_path = '/home/uba/Desktop/azs/video/test-opencv/frame0-03-56.52.jpg'
faces = RetinaFace.detect_faces(img_path)
print(faces)
print(datetime.now() - start_time)
img = cv2.imread(img_path)

for face in faces.keys():
identity = faces[face]
facial_area = identity['facial_area']
cv2.rectangle(img, (facial_area[2], facial_area[3]), (facial_area[0], facial_area[1]), (255, 255, 255), 1)

cv2.imshow('', img)
cv2.waitKey(0)
cv2.destroyAllWindows()`

Computer:
AMD Ryzen 5 3600 6-Core Processor
GeForce GTX 1660
ram 16+16+8
Ubuntu 20.04

Why so slow ?

@ninnnnnnr
Copy link
Author

result time my code 3 second

@serengil
Copy link
Owner

yes retinaface is very complex model and it runs slow

you might consider to use opencv if you have a speed concern.

@serengil serengil added the question Further information is requested label Jan 28, 2022
@ninnnnnnr
Copy link
Author

ninnnnnnr commented Jan 28, 2022

yes retinaface is very complex model and it runs slow

you might consider to use opencv if you have a speed concern.

Is it possible to run using GPU ?

@joaocassianox7x
Copy link

Yes @ninnnnnnr it's possible. Just check if your TensorFlow it's detecting the GPU with

tf.test.gpu_device_name()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants