文件是:image_processor_yolovfastest.cpp
推理部分代码是:
void ImageProcessorYolovFastest::Process(const std::shared_ptr
& image, std::vector<T_DjiLiveViewBoundingBox>& bounding_boxes) {
auto detect = [&](cv::Mat& frame, std::vectorcv::Mat& outs) {
cv::Mat blob;
cv::dnn::blobFromImage(frame, blob, 1 / 255.0, cv::Size(320, 320), cv::Scalar(0, 0, 0), true, false);
net_.setInput(blob);
net_.forward(outs, net_.getUnconnectedOutLayersNames());
};
cv::Mat frame = *image;
std::vector<cv::Mat> outs;
detect(frame, outs);
post_process(frame, outs, bounding_boxes);
}