You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tik = time.time()
faces = detector.detect([img, img, img, img, img])
print(f"time taken: {time.time()-tik}")
` @elliottzheng could you please have a look at this code and help me to solve this issue?
The text was updated successfully, but these errors were encountered:
zeahmd
changed the title
Batch Inference with RetinaFace is slower than single image of Insightface
Batch Inference with RetinaFace is slower than single image inference of Insightface
Mar 1, 2022
`
import numpy as np
from insightface.app import FaceAnalysis
import cv2
import matplotlib.pyplot as plt
import time
from batch_face import RetinaFace
img = cv2.imread('/home/zeeshan/Downloads/musk.jpg')
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = cv2.resize(img, (640, 640))
plt.imshow(img)
model = FaceAnalysis(allowed_modules=['detection'],
providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
model.prepare(ctx_id=0)
detector = RetinaFace(gpu_id=0)
tik = time.time()
faces = model.get(img)
faces = model.get(img)
faces = model.get(img)
faces = model.get(img)
faces = model.get(img)
print(f"time taken: {time.time()-tik}")
tik = time.time()
faces = detector.detect([img, img, img, img, img])
print(f"time taken: {time.time()-tik}")
`
@elliottzheng could you please have a look at this code and help me to solve this issue?
The text was updated successfully, but these errors were encountered: