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
update_C# #1076
base: develop
Are you sure you want to change the base?
update_C# #1076
Conversation
update_C# |
else if (nChannel == 4) | ||
{ | ||
nType = CV_8UC4; | ||
else if (nChannel == 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们现在应该只支持 channel 为3的图片, 如果其他通道先打印一个提示 + 返回fasle, 避免用户看到你的代码以为支持多通道
std::cout << "det model predict success" << std::endl; | ||
} | ||
// nBoxesNum[0] = results.size(); // results.size()得到的是batch_size | ||
nBoxesNum[0] = results[0].det_result->boxes.size(); // 得到单张图片预测的bounding box数 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
既然只支持单张图片, nboxesNum 就用int就行了..
} | ||
std::vector<uint8_t> result_map = results[0].seg_result->label_map.data; // vector<uint8_t> -- 结果map | ||
// 拷贝输出结果到输出上返回 -- 将vector<uint8_t>转成unsigned char * | ||
memcpy(output, &result_map[0], result_map.size() * sizeof(uchar)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result_map.size() 可能用result_map.shape会更准,计算shape 乘积的值:
size = std::accumulate(result_map.shape.begin(),
result_map.shape.end(), 1, std::multiplies());
// limitations under the License. | ||
|
||
#include <gflags/gflags.h> | ||
#include <gflags/gflags.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果没有 DEFINE_string 等应该是不需要这个头文件的
issue #1131 上说的文档问题,这次也说明清楚吧 |
此为PR说明模版
如提交的为部署C++代码,请确认以下自测点是否完成(完成勾选即可),并保留以下的自测点列表,便于Reviewer知晓。