秒合约系统开发(开发项目)丨秒合约交易所系统开发(方案逻辑)/案例分析/源码设计/程序开发

简介:   Web3.0通过将信息交互从屏幕转移到物理空间,改变了终端用户体验,因而也有称Web3.0为“空间网络(Spatial Web)”。该“空间网络”包括空间交互层(利用智能眼镜或语音等实现实时信息交互)、数字信息层(借助传感和数字映射为每一个对象创建数字孪生)和物理层(通过感观了解和体验的世界)。

  

  Web3.0通过将信息交互从屏幕转移到物理空间,改变了终端用户体验,因而也有称Web3.0为“空间网络(Spatial Web)”。该“空间网络”包括空间交互层(利用智能眼镜或语音等实现实时信息交互)、数字信息层(借助传感和数字映射为每一个对象创建数字孪生)和物理层(通过感观了解和体验的世界)。

  DAPP是去中心化应用程序/分布式的应用程序,是底层区块链平台生态上衍生的各种分布式应用,也是区块链世界中的基础服务提供方。将应用程序分布在不同节点上,通过共识机制和区块链平台来完成任务的应用程序,它本身就是去中心化,不依赖于任何中心化服务器,促使用户交易更加安全。

  数据作为新型生产要素,能为实体经济带来放大、叠加和倍增作用,是做强做优做大数字经济的关键。建立数据可信流通体系,增强数据的可用、可信、可流通、可追溯水平,是激活数据要素潜能、赋能实体经济的重要途径。区块链技术具有去中心化、共识机制、不可篡改、可以追溯、规则透明等特点。

  int backendType[2];

  net->getSessionInfo(session,MNN::Interpreter::BACKENDS,backendType);

  MNN_PRINT("Session Info:memory use%f MB,flops is%f M,backendType is%d,batch size=%dn",memoryUsage,flops,backendType[0],argc-2);

  //获取输出tensor的信息

  auto output=net->getSessionOutput(session,NULL);

  if(nullptr==output||output->elementSize()==0){

  MNN_ERROR("Resize error,the model can't run batch:%dn",shape[0]);

  return 0;

  }

  //定义真正输入数据inputUser

  std::shared_ptr<Tensor>inputUser(new Tensor(input,Tensor::TENSORFLOW));

  auto bpp=inputUser->channel();

  auto size_h=inputUser->height();

  auto size_w=inputUser->width();

  MNN_PRINT("input:w:%d,h:%d,bpp:%dn",size_w,size_h,bpp);

  //依次填充batch张图片数据到inputUser

  for(int batch=0;batch<shape[0];++batch){

  auto inputPatch=argv[batch+2];

  int width,height,channel;

  auto inputImage=stbi_load(inputPatch,&width,&height,&channel,4);

  if(nullptr==inputImage){

  MNN_ERROR("Can't open%sn",inputPatch);

  return 0;

  }

  MNN_PRINT("origin size:%d,%dn",width,height);

  //trans是图像变换矩阵,可以用来做缩放、旋转等图像变换,避免引入opencv

  Matrix trans;

  //Set transform,from dst scale to src,the ways below are both ok

  #ifdef USE_MAP_POINT

  float srcPoints[]={

  0.0f,0.0f,

  0.0f,(float)(height-1),

  (float)(width-1),0.0f,

  (float)(width-1),(float)(height-1),

  };

  float dstPoints[]={

  0.0f,0.0f,

  0.0f,(float)(size_h-1),

  (float)(size_w-1),0.0f,

  (float)(size_w-1),(float)(size_h-1),

  };

  trans.setPolyToPoly((Point)dstPoints,(Point)srcPoints,4);

  #else

  trans.setScale((float)(width-1)/(size_w-1),(float)(height-1)/(size_h-1));

  #endif

  //MNN中使用CV::ImageProcess进行图像处理

  ImageProcess::Config config;

  config.filterType=BILINEAR;

  float mean[3]={103.94f,116.78f,123.68f};

  float normals[3]={0.017f,0.017f,0.017f};

  //float mean[3]={127.5f,127.5f,127.5f};

  //float normals[3]={0.00785f,0.00785f,0.00785f};

  ::memcpy(config.mean,mean,sizeof(mean));

  ::memcpy(config.normal,normals,sizeof(normals));

  //图像格式转换:RGBA(.png)->BGR(模型输入要求)

  config.sourceFormat=RGBA;

  config.destFormat=BGR;

  std::shared_ptr<ImageProcess>pretreat(ImageProcess::create(config));

  pretreat->setMatrix(trans);

  //执行图像处理

  pretreat->convert((uint8_t)inputImage,width,height,0,inputUser->host<uint8_t>()+inputUser->stride(0)batch*inputUser->getType().bytes(),size_w,size_h,bpp,0,inputUser->getType());

  stbi_image_free(inputImage);

  }

  //拷贝真实输入数据到会话中

  input->copyFromHostTensor(inputUser.get());

  //执行会话

  net->runSession(session);

  auto dimType=output->getDimensionType();

  if(output->getType().code!=halide_type_float){

  dimType=Tensor::TENSORFLOW;

  }

  //定义输出数据承接outputUser

  std::shared_ptr<Tensor>outputUser(new Tensor(output,dimType));

  //拷贝到outputUser

  output->copyToHostTensor(outputUser.get());

  //获取输出类型:可能是数据类型?

  auto type=outputUser->getType();

  //对每一张图

  for(int batch=0;batch<shape[0];++batch){

  MNN_PRINT("For Image:%sn",argv[batch+2]);

  auto size=outputUser->stride(0);

  //用std::pair承接序号,置信度

  std::vector<std::pair<int,float>>tempValues(size);

  //对每种输出类型,分别解析

  if(type.code==halide_type_float){

  auto values=outputUser->host<float>()+batch*outputUser->stride(0);

  for(int i=0;i<size;++i){

  tempValues<i>=std::make_pair(i,values<i>);

  }

  }

  if(type.code==halide_type_uint&&type.bytes()==1){

  auto values=outputUser->host<uint8_t>()+batch*outputUser->stride(0);

  for(int i=0;i<size;++i){

  tempValues<i>=std::make_pair(i,values<i>);

  }

  }

  if(type.code==halide_type_int&&type.bytes()==1){

  auto values=outputUser->host<int8_t>()+batch*outputUser->stride(0);

  for(int i=0;i<size;++i){

  tempValues<i>=std::make_pair(i,values<i>);

  }

  }

  //Find Max按置信度排序

  std::sort(tempValues.begin(),tempValues.end(),

  {return a.second>b.second;});

  //打印top10信息

  int length=size>10?10:size;

  for(int i=0;i<length;++i){

  MNN_PRINT("%d,%fn",tempValues<i>.first,tempValues<i>.second);

  }

  }

  return 0;

  }

相关文章
|
8天前
|
域名解析 人工智能 Linux
|
19天前
|
Linux Go 开发工具
手机上跑 DeepSeek 智能体:开源安卓客户端 DSH Go 安装与使用指南
DSH Go 是一款开源安卓客户端,将 DeepSeek Harness 智能体引擎装进手机:免 Root、免 Termux,一键安装即用;支持本机运行(内置 Ubuntu+Node.js)或远程接管电脑会话;具备插话打断、过程折叠、屏幕操控、端到端加密分享等特色功能,真正实现智能体“口袋化”。
17284 63
|
17天前
|
人工智能
Google 提示「所在地区不可用」?进不去 Antigravity 或 Gemini,先查账号这个设置
进不去 Antigravity 或 Gemini,提示所在地区不可用?三步查清 Google 账号关联地区、官方更正表单理由选法与改区注意事项。
Google 提示「所在地区不可用」?进不去 Antigravity 或 Gemini,先查账号这个设置
|
2天前
|
人工智能 安全 网络安全
|
6天前
|
云安全 数据采集 人工智能
|
7天前
|
Linux API iOS开发
【DSH】DeepSeek Harness新手保姆教程(下载+安装+配置+使用,2026最新实测)
DeepSeek Harness(dsh)是 DeepSeek AI 开源的智能体框架,秉持“一切皆插件”理念,支持读文件、改代码、执行命令、处理表格等自动化任务;免费开源,兼容 Win/macOS,需配 API 密钥使用。(239字)
1323 3
|
14天前
|
人工智能 开发工具 开发者
2026最新codex下载安装保姆级使用教程(下载+安装+登录+使用,含所有历史版本)
Codex 是 OpenAI 推出的开源 AI 编程智能体,跑在本地终端和桌面客户端里,能读懂整个代码仓库,一句自然语言就能让它改代码、执行命令、跑测试、修 Bug,支持 Windows、macOS、Linux 三大平台。本文把 Codex下载、安装、登录、汉化、基础使用一次讲全,并整理了国内用户最常踩的坑,跟着做 10 分钟就能跑起来。
2394 7
|
19天前
|
弹性计算 人工智能 API
Codex超详细入门指南(下载·安装·登录·上手,全版本覆盖,2026最新版)
建议收藏本教程,2026 全年各版本更新随时回来查阅。如果你在搭建过程中遇到任何问题,欢迎结合 阿里云工单系统 提交技术支持请求,或在 阿里云开发者社区 搜索 Codex 相关话题交流。 祝你编码愉快,效率翻倍!
3868 22
|
20天前
|
Linux API iOS开发
【DSH】DeepSeek Harness新手保姆教程(下载+安装+配置+使用,2026最新实测)
DeepSeek Harness(dsh)是DeepSeek AI开源的智能体框架,秉持“一切皆插件”理念,支持读文件、改代码、跑命令、处理表格、联网搜索等操作。免费开源,兼容Windows/macOS/Linux,提供桌面端与网页端,可灵活安装插件扩展能力。