五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

永續(xù)合約交易所系統(tǒng)開發(fā)技術(shù)分析(案例項目)

2023-07-17 17:24 作者:搭建v_deitly123  | 我要投稿

int PFLD::Impl::ExtractKeypoints(const cv::Mat& img_face, std::vector<cv::Point2f>* keypoints) {

? ? std::cout << "start extract keypoints." << std::endl;

? ? keypoints->clear();

? ? if (!initialized_) {

? ? ? ? std::cout << "model uninitialed." << std::endl;

? ? ? ? return 10000;

? ? }

? ? if (img_face.empty()) {

? ? ? ? std::cout << "input empty." << std::endl;

? ? ? ? return 10001;

? ? }

? ? // image prepocess

? ? cv::Mat face_cpy = img_face.clone();

? ? int width = face_cpy.cols;

? ? int height = face_cpy.rows;

? ? float scale_x = static_cast<float>(width) / inputSize_;

? ? float scale_y = static_cast<float>(height) / inputSize_;

?

? ? cv::Mat face_resized;

? ? cv::resize(face_cpy, face_resized, cv::Size(inputSize_, inputSize_));

? ? face_resized.convertTo(face_resized, CV_32FC3);

? ? face_resized = (face_resized - 123.0f) / 58.0f;

?

? ? auto tensor_data = input_tensor_->host<float>();

? ? auto tensor_size = input_tensor_->size();

? ? ::memcpy(tensor_data, face_resized.data, tensor_size);

?

? ? auto input_tensor = landmarker_->getSessionInput(session_, nullptr);

? ? input_tensor->copyFromHostTensor(input_tensor_);

? ? landmarker_->runSession(session_);

?

? ? // get output

? ? std::string output_tensor_name0 = "conv5_fwd";

? ? MNN::Tensor* tensor_landmarks = landmarker_->getSessionOutput(session_, output_tensor_name0.c_str());

? ? MNN::Tensor tensor_landmarks_host(tensor_landmarks, tensor_landmarks->getDimensionType());

? ? tensor_landmarks->copyToHostTensor(&tensor_landmarks_host);

?

? ? std::cout << "batch:? ? " << tensor_landmarks->batch()? ? << std::endl?

? ? ? ? ? ? ? << "channels: " << tensor_landmarks->channel()? << std::endl

? ? ? ? ? ? ? << "height:? ?" << tensor_landmarks->height()? ?<< std::endl

? ? ? ? ? ? ? << "width:? ? " << tensor_landmarks->width()? ? << std::endl

? ? ? ? ? ? ? << "type:? ? ?" << tensor_landmarks->getDimensionType() << std::endl;?

?

? ? auto landmarks_dataPtr = tensor_landmarks_host.host<float>();

? ? int num_of_points = 98;

? ? for (int i = 0; i < num_of_points; ++i) {

? ? ? ? cv::Point2f curr_pt(landmarks_dataPtr[2 * i + 0] * scale_x,

? ? ? ? ? ? ? ? ? ? ? ? ? ? landmarks_dataPtr[2 * i + 1] * scale_y);

? ? ? ? keypoints->push_back(curr_pt);

? ? }

?

? ? std::cout << "end extract keypoints." << std::endl;

?

? ? return 0;

}


永續(xù)合約交易所系統(tǒng)開發(fā)技術(shù)分析(案例項目)的評論 (共 條)

分享到微博請遵守國家法律
苍南县| 诸城市| 武川县| 五河县| 虎林市| 勃利县| 邛崃市| 黑水县| 洛阳市| 西和县| 基隆市| 廊坊市| 三江| 宜川县| 香港| 河北省| 玛纳斯县| 同德县| 会东县| 卫辉市| 遵义市| 南和县| 镇远县| 丰都县| 德兴市| 西乌| 北宁市| 保德县| 门头沟区| 葫芦岛市| 色达县| 石渠县| 武义县| 哈巴河县| 丰都县| 芜湖市| 襄城县| 无棣县| 来安县| 黑河市| 江永县|