Comments (5)
if you use caffe, replace cube to "caffe:Blob"
from retinaface-cpp.
mxnet 如何替换,有没有提示性质的建议
from retinaface-cpp.
参考mxnet c++接口的例子
from retinaface-cpp.
int AnchorGenerator::FilterAnchor(mxnet::cpp::NDArray& cls, mxnet::cpp::NDArray& reg, mxnet::cpp::NDArray& pts, std::vector& result)
{
assert(cls.GetShape()[1] == anchor_num2);
assert(reg.GetShape()[1] == anchor_num4);
int pts_length = 0;
assert(pts.GetShape()[1] % anchor_num == 0);
pts_length = pts.GetShape()[1]/anchor_num/2;
int w = cls.GetShape()[3];
int h = cls.GetShape()[2];
for (int i = 0; i < h; ++i) {
for (int j = 0; j < w; ++j) {
int id = i * w + j;
for (int a = 0; a < anchor_num; ++a)
{
//std::cout<< j << "--------"<< i << "--------"<< id << "--------"<<cls.channel(anchor_num + a)[id]<<std::endl;
if (cls.GetData()[(anchor_num + a) * h * w + id] >= cls_threshold) {
//printf("cls %f\n", cls.channel(anchor_num + a)[id]);
CRect2f box(j * anchor_stride + preset_anchors[a][0],
i * anchor_stride + preset_anchors[a][1],
j * anchor_stride + preset_anchors[a][2],
i * anchor_stride + preset_anchors[a][3]);
//printf("%f %f %f %f\n", box[0], box[1], box[2], box[3]);
CRect2f delta(reg.GetData()[(a*4+0) * h * w+id],
reg.GetData()[(a*4+1) * h * w+id],
reg.GetData()[(a*4+2) * h * w+id],
reg.GetData()[(a*4+3) * h * w+id]);
Anchor res;
res.anchor = cv::Rect_< float >(box[0], box[1], box[2], box[3]);
bbox_pred(box, delta, res.finalbox);
//printf("bbox pred\n");
res.score = cls.GetData()[(anchor_num + a) * h * w+id];
res.center = cv::Point(j,i);
//printf("center %d %d\n", j, i);
if (1) {
std::vector<cv::Point2f> pts_delta(pts_length);
for (int p = 0; p < pts_length; ++p) {
pts_delta[p].x = pts.GetData()[(a*pts_length*2+p*2) * h * w+id];
pts_delta[p].y = pts.GetData()[(a*pts_length*2+p*2+1) * h * w+id];
}
//printf("ready landmark_pred\n");
landmark_pred(box, pts_delta, res.pts);
//printf("landmark_pred\n");
}
result.push_back(res);
}
}
}
}
return 0;
}
from retinaface-cpp.
@Charrin @dwjlw1314 @zys1994 What is Cube? is it C++ class?
from retinaface-cpp.
Related Issues (20)
- About the result test on WiderFace_val set for SINGLE SCALE HOT 3
- why resize to 300x300 before extraction HOT 15
- How can I elevate the model performance? HOT 1
- error C2065: “anchor”: 未声明的标识符 HOT 3
- Cube not defined HOT 1
- R50 mxnet convert to ncnn parameter file has inconsistent HOT 1
- onnx model when convert model HOT 1
- Onnx model HOT 1
- the inference time not stable HOT 2
- MXNet2caffe HOT 2
- is crop necessary? HOT 2
- 关于用MNN推理框架在树莓派4B推理速度
- Got different output between Mxnet and caffe anything wrong? HOT 16
- 模型问题 HOT 3
- 运行环境 HOT 1
- 使用vulkan 进行GPU加速
- Run on CPU only
- How to run inference using provided models
- crop 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 retinaface-cpp.