Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

update_C# #1076

wants to merge 2 commits into from

Conversation

yzl19940819
Copy link
Collaborator

此为PR说明模版

如提交的为部署C++代码,请确认以下自测点是否完成(完成勾选即可),并保留以下的自测点列表,便于Reviewer知晓。

  • Linux下测试通过
    • batch = 1 预测
    • batch > 1预测
    • 多GPU卡预测
    • TensorRT预测
    • Triton预测
  • Windows下测试通过
    • batch = 1预测
    • batch > 1预测

@yzl19940819
Copy link
Collaborator Author

update_C#

else if (nChannel == 4)
{
nType = CV_8UC4;
else if (nChannel == 4)
Copy link
Collaborator

@heliqi heliqi Aug 26, 2021

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数
Copy link
Collaborator

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));
Copy link
Collaborator

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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果没有 DEFINE_string 等应该是不需要这个头文件的

@FlyingQianMM
Copy link
Collaborator

issue #1131 上说的文档问题,这次也说明清楚吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants