Comments (4)
你的测试环境是什么?
from retinaface.
@clancylian 1070gpu i7的cpu
import` cv2
import sys
import numpy as np
import datetime
import os
import glob
from retinaface import RetinaFace
import mxnet as mx
import time
thresh = 0.8
scales = [640,640]
count = 1
gpuid = 0
context = mx.gpu(0)
detector = RetinaFace('./model/mnet.25', 0, -1, 'net3')
stream = cv2.VideoCapture(0)
stream.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
stream.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
_, img = stream.read()
im_shape = img.shape
target_size = scales[0]
max_size = scales[1]
im_size_min = np.min(im_shape[0:2])
im_size_max = np.max(im_shape[0:2])
#im_scale = 1.0
#if im_size_min>target_size or im_size_max>max_size:
im_scale = float(target_size) / float(im_size_min)
# prevent bigger axis from being more than max_size:
if np.round(im_scale * im_size_max) > max_size:
im_scale = float(max_size) / float(im_size_max)
print('im_scale', im_scale)
scales = [im_scale]
while 1:
ret, img = stream.read()
img_base = img.copy()
flip = False
t = time.time()
for c in range(count):
faces, landmarks = detector.detect(img, thresh, scales=scales, do_flip=flip)
print(c, faces.shape, landmarks.shape)
if faces is not None:
print('find', faces.shape[0], 'faces')
for i in range(faces.shape[0]):
#print('score', faces[i][4])
box = faces[i].astype(np.int)
#color = (255,0,0)
color = (0,0,255)
cv2.rectangle(img_base, (box[0], box[1]), (box[2], box[3]), color, 2)
if landmarks is not None:
landmark5 = landmarks[i].astype(np.int)
#print(landmark.shape)
for l in range(landmark5.shape[0]):
color = (0,0,255)
if l==0 or l==3:
color = (0,255,0)
cv2.circle(img, (landmark5[l][0], landmark5[l][1]), 1, color, 2)
cv2.imshow("a", img_base)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
print(time.time() - t)
cap.release()
from retinaface.
这个不应该吧,R50都比这个块。
from retinaface.
你的测试机是什么环境呢?显卡用的什么?
from retinaface.
Related Issues (20)
- mxnet model HOT 2
- Build Error HOT 5
- resizeconvertion.cu HOT 2
- mxnet的速度是用官方insightface代码测试出来的吗?还是自己做过优化? HOT 1
- 请问你这个代码比官方的快吗?
- building on mobile
- none
- 用pytorch转换的onix模型,可以用你的代码调用吗?
- tensorrt version and opencv version? HOT 2
- what's your tensorrt version?
- 怎样才能把caffe模型修改成可以tensorRT的格式? HOT 1
- how can i build on windows HOT 1
- retinaface res50 have alittle question
- 使用caffe时能否设置多GPU同时工作?
- Batchsize support for image processing with Cuda
- tensort模型检测结果与caffe模型相差较大 HOT 1
- cudnn_conv_layer.cpp:56] Check failed: error == cudaSuccess (2 vs. 0) out of memory
- Why the test time when using USE_CAFFE and USE_TENSORRT is almost same?为什么测试时间差不多
- mnet-deconv-0517.table.int8 only 7.6KB
- Docker for this project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retinaface.