MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / draw_result

Method draw_result

source/MaaFramework/Vision/NeuralNetworkClassifier.cpp:125–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125cv::Mat NeuralNetworkClassifier::draw_result(const Result& res) const
126{
127 cv::Mat image_draw = draw_roi();
128 cv::Point pt(res.box.x + res.box.width + 5, res.box.y + 20);
129
130 for (size_t i = 0; i != res.raw.size(); ++i) {
131 const auto color = i == res.cls_index ? cv::Scalar(0, 0, 255) : cv::Scalar(255, 0, 0);
132 std::string text = std::format("{} {}: prob {:.3f}, raw {:.3f}", i, param_.labels[i], res.probs[i], res.raw[i]);
133 cv::putText(image_draw, text, pt, cv::FONT_HERSHEY_PLAIN, 1.2, color, 1);
134 pt.y += 20;
135 }
136
137 return image_draw;
138}
139
140void NeuralNetworkClassifier::sort_(ResultsVec& results) const
141{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected