欢迎光临散文网 会员登陆 & 注册

现货量化合约跟单系统开发(对接API火币/币安/OK)/成熟技术/源码功能/方案策略

2023-07-01 09:52 作者:bili_36625761919  | 我要投稿

  量化交易就是以数学公式和统计数据等为基础来建立数学模型,通过数学模型来进行交易。


  量化交易依托的是现在高度发达的计算机技术和互联网技术。


  量化交易通过数学模型来代替人工交易,It can effectively avoid the subjective judgment of investors,which is the impact of investor sentiment fluctuations.Avoid making irrational decisions in extreme fanaticism or pessimism.


  量化交易需要以大量的数据作为基础,通过对大量数据的分析,来做出理性的判断,预测未来价格的走势。


  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;


  }


现货量化合约跟单系统开发(对接API火币/币安/OK)/成熟技术/源码功能/方案策略的评论 (共 条)

分享到微博请遵守国家法律