永续合约及合约交易系统开发需求项目方案部署

web3.js是一个JavaScript API库。要让DApp在以太坊上运行,我们可以使用web3.js库提供的web3对象。web3.js通过RPC调用与本地节点通信,它可以与任何公开RPC层的以太坊节点一起使用。web3包含eth对象-web3.eth(用于与以太坊区块链交互)和shh对象-web3.shh(用于与Whisper交互)class PFLD::Impl {public: Impl() { device = 0; precision = 0; power = 0; memory = 0; initialized = false; } ~Impl() { landmarker->releaseModel(); landmarker->releaseSession(session); } int LoadModel(const char root_path); int ExtractKeypoints(const cv::Mat& img_face, std::vector<cv::Point2f> keypoints); std::sharedptr<MNN::Interpreter> landmarker; 【方案部署搭建可V or TG我昵称】 const int inputSize = 96; int device; int precision; int power; int memory; MNN::Session* session = nullptr; MNN::Tensor inputtensor = nullptr; bool initialized_;};int PFLD::Impl::LoadModel(const char root_path) { std::string model_file = std::string(rootpath) + "/pfld-lite.mnn"; landmarker = std::shared_ptr<MNN::Interpreter>(MNN::Interpreter::createFromFile(model_file.c_str())); MNN::ScheduleConfig config; config.numThread = 1; config.type = staticcast<MNNForwardType>(device); MNN::BackendConfig backendConfig; backendConfig.precision = (MNN::BackendConfig::PrecisionMode)precision; backendConfig.power = (MNN::BackendConfig::PowerMode) power; backendConfig.memory = (MNN::BackendConfig::MemoryMode) memory; config.backendConfig = &backendConfig; session = landmarker->createSession(config); // nhwc to nchw std::vector<int> dims{1, inputSize, inputSize_, 3}; inputtensor = MNN::Tensor::create<float>(dims, NULL, MNN::Tensor::TENSORFLOW); initialized_ = true; return 0;}

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务