Comments (6)
哈?所有的onnx以及在这个repo里面了
from onnx-scrfd-flask.
哈哈,谢谢啦,我没弄对onnx环境,现在弄好了,权重有了。
但是有一个新问题,如果用scrfd_34g.onnx,如何指定input_size 的大小。
detector = SCRFD(model_file='onnx/scrfd_34g.onnx')
bboxes, kpss = detector.detect(frame, 0.5, input_size = (frame.shape[0], frame.shape[1]))
up主给的是scrfd_2.5g_bnkps_shape160x160.onnx的,固定输入大小160x160.
from onnx-scrfd-flask.
下面是完整的一个测试代码,用up主给的代码改的。
import argparse
from tools.scrfd import *
import datetime
import cv2
frame=cv2.imread("./image008006.jpg")
detector = SCRFD(model_file='onnx/scrfd_34g.onnx')
bboxes, kpss = detector.detect(frame, 0.5, input_size = (frame.shape[0], frame.shape[1]))
for i in range(bboxes.shape[0]):
bbox = bboxes[i]
x1, y1, x2, y2, score = bbox.astype(np.int)
cv2.rectangle(frame, (x1, y1), (x2, y2), (255, 0, 0), 2)
if kpss is not None:
kps = kpss[i]
for kp in kps:
kp = kp.astype(np.int)
cv2.circle(frame, tuple(kp), 1, (0, 0, 255), 2)
ret, jpeg = cv2.imencode('.jpg', frame)
frame = jpeg.tobytes()
print(bboxes)
from onnx-scrfd-flask.
我改成了640和640,能跑了,但是不是很懂原理。这里的input_size目的是什么,只有看看源码了。
from onnx-scrfd-flask.
是的,如果你使用静态图的方式提取的onnx,那么在ncnn的程序中只能使用你提取的那个尺寸,比如你提取的是时候固定了640,那么检测需要固定640,但是如果你用的是动态尺寸,也就是提取的时候使用的是-1,那么ncnn程序的尺寸对你是没有影响的
from onnx-scrfd-flask.
好的,谢谢up主!另外,github上无法上传大文件到项目,所以up主的onnx目录下不是完整的onnx文件,可以改善一下。
from onnx-scrfd-flask.
Related Issues (3)
- 请问scrfd里面提取的特征值在哪。 HOT 3
- Converting to onnx HOT 2
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 onnx-scrfd-flask.