src/yolov4-tiny/yolov4-tiny.cc
/*
 * Compute yolo model and get the output
 * @param
 *     [in] inputImg: input image
 *     [out] result_box: result bounding box of input image
 * @return
 *     status: if no valid bbox return false else true
 *  */
Compute yolo model and get the output
@param
[in] inputImg: input image
[out] result_box: result bounding box of input image
@return
status: if no valid bbox return false else true
Compute yolo model and get the output @param [ in ] inputImg : input image [ out ] result_box : result bounding box of input image @return status : if no valid bbox return false else true
bool Yolov4Tiny::invoke(cv::Mat inputImg, std::vector<cv::Rect> &result_box){
    result_box.clear();
    inputImg = matPreprocess(inputImg,
                             inp_tensor_->dims->data[2],
                             inp_tensor_->dims->data[1],
                             yolov4_norm);
    memcpy(inp_tensor_->data.f, inputImg.ptr<float>(0),
           inp_tensor_->dims->data[1] * inp_tensor_->dims->data[2] *
           inp_tensor_->dims->data[3] * sizeof(float));
    interpreter_->Invoke();
    std::vector<float> box_vec   = cvtTensor(out_tensor_box_);
    std::vector<float> score_vec = cvtTensor(out_tensor_score_);
    return postprocess(box_vec, score_vec, result_box);
}
bool Yolov4Tiny :: invoke ( cv :: Mat inputImg , std :: vector < cv :: Rect > & result_box ) { result_box . clear ( ) ; inputImg = matPreprocess ( inputImg , inp_tensor_ -> dims -> data [ 2 ] , inp_tensor_ -> dims -> data [ 1 ] , yolov4_norm ) ; memcpy ( inp_tensor_ -> data . f , inputImg . ptr < float > ( 0 ) , inp_tensor_ -> dims -> data [ 1 ] * inp_tensor_ -> dims -> data [ 2 ] * inp_tensor_ -> dims -> data [ 3 ] * sizeof ( float ) ) ; interpreter_ -> Invoke ( ) ; std :: vector < float > box_vec = cvtTensor ( out_tensor_box_ ) ; std :: vector < float > score_vec = cvtTensor ( out_tensor_score_ ) ; return postprocess ( box_vec , score_vec , result_box ) ; }
Compute yolo model and get the output
 @param
     [in] inputImg: input image
     [out] result_box: result bounding box of input image
 @return
     status: if no valid bbox return false else true
Compute yolo model and get the output @param [ in ] inputImg : input image [ out ] result_box : result bounding box of input image @return status : if no valid bbox return false else true