thingsboard接入臻识道闸

thingsboard 和tb-gateway 是通过源码idea启动测试开发

为了测试这里只是买了臻识道闸的摄像机模组方便调试,然后添加一个开关量开关模拟雷达

image.png

道闸品牌

臻识C3R3C5R5变焦500万车牌识别相机高速追逃费相机华厦V86像机
淘宝地址 https://item.taobao.com/item.htm?_u=s1thkikq47ab&id=705371091697&spm=a1z09.2.0.0.2fe72e8dxewbm6
image.png

image.png

了解道闸协议

这里通过mqtt进行通信,下面是臻识道闸的mqtt通信协议,这里只是截图用到的部分

道闸识别车牌结果发送topic

车牌识别topic ${sn}/device/message/up/ivs_result
image.png
image.png
image.png
image.png

下发设备io事件开闸

开闸topic ${sn}/device/message/down/gpio_out
image.png
image.png

thingsboard 设置

1.在平台添加一个网关,设置为网关
image.png

配置iot gateway 并且启动

  1. 修改iot gateway 配置文件路径:thingsboard_gateway/config/tb_gateway.json
    设置host 为thingsboard服务器的mqtt地址
    image.png

  2. 复制网关token到gateway配置
    image.png
    粘贴到accessToken
    image.png

  3. 开启gprc
    image.png

  4. 添加mqtt配置引用
    image.png
    下面是总的配置文件不要直接复制我的,token不一样

{  "thingsboard": {  "host": "127.0.0.1",   "port": 1883,  "remoteShell": false,  "remoteConfiguration": true,  "statistics": {  "enable": true,  "statsSendPeriodInSeconds": 3600  },  "deviceFiltering": {  "enable": false,  "filterFile": "list.json"  },  "maxPayloadSizeBytes": 1024,  "minPackSendDelayMS": 200,  "minPackSizeToSend": 500,  "checkConnectorsConfigurationInSeconds": 60,  "handleDeviceRenaming": true,  "security": {  "type": "accessToken",  "accessToken": "QWk7kMTZsdjQC8nVEo7f"  },  "qos": 1,  "checkingDeviceActivity": {  "checkDeviceInactivity": false,  "inactivityTimeoutSeconds": 200,  "inactivityCheckPeriodSeconds": 500  }  },  "storage": {  "type": "memory",  "read_records_count": 100,  "max_records_count": 100000,  "data_folder_path": "./data/",  "max_file_count": 10,  "max_read_records_count": 10,  "max_records_per_file": 10000,  "data_file_path": "./data/data.db",  "messages_ttl_check_in_hours": 1,  "messages_ttl_in_days": 7  },  "grpc": {  "enabled": true,  "serverPort": 9595,  "keepaliveTimeMs": 10000,  "keepaliveTimeoutMs": 5000,  "keepalivePermitWithoutCalls": true,  "maxPingsWithoutData": 0,  "minTimeBetweenPingsMs": 10000,  "minPingIntervalWithoutDataMs": 5000,  "keepAliveTimeMs": 10000,  "keepAliveTimeoutMs": 5000  },  "connectors": [  {  "name": "MQTT Broker Connector",  "type": "mqtt",  "configuration": "mqtt.json"  }  ]  
}
  1. 启动一个 mqtt broker,这里用docker 启动
docker run -d --name emqx -p 1883:1883 -p 8083:8083 -p 8084:8084 -p 8883:8883 -p 18083:18083 emqx/emqx:5.3.2
  1. 配置mqtt.json
    5.1 配置文件路径:thingsboard_gateway/config/mqtt.json
    修改成你自己启动的mqtt broker
    image.png
    5.2 在"mapping"[]里面添加下面配置
    这个/device/message/up/ivs_result 是臻识道闸车牌识别topic
    timeseries内的是重新组合设备数据
    eventType 字段是事件触发类型1代表是车牌识别
    license 车牌 base64加密
    full_image_content 车牌拍照图片 base64加密
{  "topicFilter": "/device/message/up/ivs_result",  "converter": {  "type": "json",  "deviceNameJsonExpression": "${sn}",  "deviceTypeJsonExpression": "臻识道闸设备配置",  "sendDataOnlyOnChange": false,  "timeout": 60000,  "attributes": [  ],  "timeseries": [  {  "type": "string",  "key": "eventType",  "value": "1"  },  {  "type": "string",  "key": "id",  "value": "${id}"  },  {  "type": "string",  "key": "sn",  "value": "${sn}"  },  {  "type": "string",  "key": "name",  "value": "${name}"  },  {  "type": "string",  "key": "version",  "value": "${version}"  },  {  "type": "long",  "key": "timestamp",  "value": "${timestamp}"  },  {  "type": "string",  "key": "license",  "value": "${payload.AlarmInfoPlate.result.PlateResult.license}"  },  {  "type": "string",  "key": "full_image_content",  "value": "${payload.AlarmInfoPlate.result.PlateResult.full_image_content}"  }  ]  }  
},

5.3 配置单向下发rpc控制
在serverSideRpc 里面下面配置配置
${deviceName}/device/message/down/gpio_out 是控制道闸开闸的topic

{  "type": "oneWay",  "deviceNameFilter": ".*",  "methodFilter": "no-reply",  "requestTopicExpression": "/${deviceName}/device/message/down/gpio_out",  "valueExpression": "${params}"  
},

具体全部配置 mqtt.json

{  "broker": {  "name": "192.168.1.73",  "host": "192.168.1.73",  "port": 1883,  "clientId": "ThingsBoard_gateway111",  "version": 5,  "maxMessageNumberPerWorker": 10,  "maxNumberOfWorkers": 100,  "sendDataOnlyOnChange": false,  "security": {  "type": "basic",  "username": "admin",  "password": "public"  }  },  "mapping": [  {  "topicFilter": "sensor/data",  "converter": {  "type": "json",  "deviceNameJsonExpression": "${serialNumber}",  "deviceTypeJsonExpression": "${sensorType}",  "sendDataOnlyOnChange": false,  "timeout": 60000,  "attributes": [  {  "type": "string",  "key": "model",  "value": "${sensorModel}"  },  {  "type": "string",  "key": "${sensorModel}",  "value": "on"  }  ],  "timeseries": [  {  "type": "double",  "key": "temperature",  "value": "${temp}"  },  {  "type": "double",  "key": "humidity",  "value": "${hum}"  },  {  "type": "string",  "key": "combine",  "value": "${hum}:${temp}"  }  ]  }  },  {  "topicFilter": "/device/message/up/ivs_result",  "converter": {  "type": "json",  "deviceNameJsonExpression": "${sn}",  "deviceTypeJsonExpression": "臻识道闸设备配置",  "sendDataOnlyOnChange": false,  "timeout": 60000,  "attributes": [  ],  "timeseries": [  {  "type": "string",  "key": "eventType",  "value": "1"  },  {  "type": "string",  "key": "id",  "value": "${id}"  },  {  "type": "string",  "key": "sn",  "value": "${sn}"  },  {  "type": "string",  "key": "name",  "value": "${name}"  },  {  "type": "string",  "key": "version",  "value": "${version}"  },  {  "type": "long",  "key": "timestamp",  "value": "${timestamp}"  },  {  "type": "string",  "key": "license",  "value": "${payload.AlarmInfoPlate.result.PlateResult.license}"  },  {  "type": "string",  "key": "full_image_content",  "value": "${payload.AlarmInfoPlate.result.PlateResult.full_image_content}"  }  ]  }  },  {  "topicFilter": "sensor/+/data",  "converter": {  "type": "json",  "deviceNameTopicExpression": "(?<=sensor/)(.*?)(?=/data)",  "deviceTypeTopicExpression": "Thermometer",  "sendDataOnlyOnChange": false,  "timeout": 60000,  "attributes": [  {  "type": "string",  "key": "model",  "value": "${sensorModel}"  }  ],  "timeseries": [  {  "type": "double",  "key": "temperature",  "value": "${temp}"  },  {  "type": "double",  "key": "humidity",  "value": "${hum}"  }  ]  }  },  {  "topicFilter": "sensor/raw_data",  "converter": {  "type": "bytes",  "deviceNameExpression": "[0:4]",  "deviceTypeExpression": "default",  "sendDataOnlyOnChange": false,  "timeout": 60000,  "attributes": [  {  "type": "raw",  "key": "rawData",  "value": "[:]"  }  ],  "timeseries": [  {  "type": "raw",  "key": "temp",  "value": "[4:]"  }  ]  }  },  {  "topicFilter": "custom/sensors/+",  "converter": {  "type": "custom",  "extension": "CustomMqttUplinkConverter",  "cached": true,  "extension-config": {  "temperatureBytes": 2,  "humidityBytes": 2,  "batteryLevelBytes": 1  }  }  }  ],  "connectRequests": [  {  "topicFilter": "sensor/connect",  "deviceNameJsonExpression": "${serialNumber}"  },  {  "topicFilter": "sensor/+/connect",  "deviceNameTopicExpression": "(?<=sensor/)(.*?)(?=/connect)"  }  ],  "disconnectRequests": [  {  "topicFilter": "sensor/disconnect",  "deviceNameJsonExpression": "${serialNumber}"  },  {  "topicFilter": "sensor/+/disconnect",  "deviceNameTopicExpression": "(?<=sensor/)(.*?)(?=/disconnect)"  }  ],  "attributeRequests": [  {  "retain": false,  "topicFilter": "v1/devices/me/attributes/request",  "deviceNameJsonExpression": "${serialNumber}",  "attributeNameJsonExpression": "${versionAttribute}, ${pduAttribute}",  "topicExpression": "devices/${deviceName}/attrs",  "valueExpression": "${attributeKey}: ${attributeValue}"  }  ],  "attributeUpdates": [  {  "retain": true,  "deviceNameFilter": ".*",  "attributeFilter": "firmwareVersion",  "topicExpression": "sensor/${deviceName}/${attributeKey}",  "valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}"  }  ],  "serverSideRpc": [  {  "type": "twoWay",  "deviceNameFilter": ".*",  "methodFilter": "echo",  "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}",  "responseTopicExpression": "sensor/${deviceName}/response/${methodName}/${requestId}",  "responseTimeout": 10000,  "valueExpression": "${params}"  },  {  "type": "oneWay",  "deviceNameFilter": ".*",  "methodFilter": "no-reply",  "requestTopicExpression": "/${deviceName}/device/message/down/gpio_out",  "valueExpression": "${params}"  },  {  "type": "oneWay",  "deviceNameFilter": ".*",  "methodFilter": "no-reply",  "requestTopicExpression": "asd/123",  "valueExpression": "${params}"  }  ],  "id": "546ac257-db5e-43a0-8d38-4755ae904aa8"  
}

配置完成启动tb-gateway服务

设置道闸规则链

在thingsboard添加一个名字为臻识道闸规则链 的责任链
image.png

注意在switch 事件切换进行事件触发判断
在script 进行组合下发命令
然后rpc call request 进行下发发送执行
image.png

switch tbel编写

function nextRelation(metadata, msg) {var arr=[];if(msg.eventType == "1") {arr.push('车牌识别触发事件');}
return arr;
}
return nextRelation(metadata, msg);

script tbel编写

msg.payload={
type: "gpio_out",body: {delay: 500,io: 0,value: 2}
};
msg.name="gpio_out";
msg.version="1.0";
var decodedData = atob(msg.license); // 解析base64车牌
if(decodedData.indexOf("无")== -1){
var msg1={method:"no-reply",params:msg};
metadata.oneway=true;
return {msg: msg1, metadata: metadata, msgType: "RPC_CALL_FROM_SERVER_TO_DEVICE"};
}

这个是规则链json,复制下来直接导入即可

{"ruleChain": {"name": "臻识道闸规则链","type": "CORE","firstRuleNodeId": null,"root": false,"debugMode": false,"configuration": null,"additionalInfo": {"description": ""}},"metadata": {"firstNodeIndex": 6,"nodes": [{"type": "org.thingsboard.rule.engine.telemetry.TbMsgTimeseriesNode","name": "Save Timeseries","debugMode": true,"singletonMode": false,"queueName": null,"configurationVersion": 0,"configuration": {"defaultTTL": 0},"additionalInfo": {"description": null,"layoutX": 569,"layoutY": 120}},{"type": "org.thingsboard.rule.engine.telemetry.TbMsgAttributesNode","name": "Save Client Attributes","debugMode": true,"singletonMode": false,"queueName": null,"configurationVersion": 2,"configuration": {"scope": "CLIENT_SCOPE","notifyDevice": false,"sendAttributesUpdatedNotification": false,"updateAttributesOnlyOnValueChange": true},"additionalInfo": {"description": null,"layoutX": 612,"layoutY": 24}},{"type": "org.thingsboard.rule.engine.filter.TbMsgTypeSwitchNode","name": "Message Type Switch","debugMode": false,"singletonMode": false,"queueName": null,"configurationVersion": 0,"configuration": {"version": 0},"additionalInfo": {"description": null,"layoutX": 257,"layoutY": 127}},{"type": "org.thingsboard.rule.engine.action.TbLogNode","name": "Log RPC from Device","debugMode": true,"singletonMode": false,"queueName": null,"configurationVersion": 0,"configuration": {"scriptLang": "TBEL","jsScript": "return '\\nIncoming message:\\n' + JSON.stringify(msg) + '\\nIncoming metadata:\\n' + JSON.stringify(metadata);","tbelScript": "return '\\nIncoming message:\\n' + JSON.stringify(msg) + '\\nIncoming metadata:\\n' + JSON.stringify(metadata);"},"additionalInfo": {"description": null,"layoutX": 554,"layoutY": 230}},{"type": "org.thingsboard.rule.engine.action.TbLogNode","name": "Log Other","debugMode": false,"singletonMode": false,"queueName": null,"configurationVersion": 0,"configuration": {"scriptLang": "TBEL","jsScript": "return '\\nIncoming message:\\n' + JSON.stringify(msg) + '\\nIncoming metadata:\\n' + JSON.stringify(metadata);","tbelScript": "return '\\nIncoming message:\\n' + JSON.stringify(msg) + '\\nIncoming metadata:\\n' + JSON.stringify(metadata);"},"additionalInfo": {"description": null,"layoutX": 554,"layoutY": 343}},{"type": "org.thingsboard.rule.engine.rpc.TbSendRPCRequestNode","name": "RPC Call Request","debugMode": true,"singletonMode": false,"queueName": null,"configurationVersion": 0,"configuration": {"timeoutInSeconds": 60},"additionalInfo": {"description": null,"layoutX": 557,"layoutY": 430}},{"type": "org.thingsboard.rule.engine.profile.TbDeviceProfileNode","name": "Device Profile Node","debugMode": false,"singletonMode": false,"queueName": null,"configurationVersion": 0,"configuration": {"persistAlarmRulesState": false,"fetchAlarmRulesStateOnStart": false},"additionalInfo": {"description": "Process incoming messages from devices with the alarm rules defined in the device profile. Dispatch all incoming messages with \"Success\" relation type.","layoutX": 190,"layoutY": 413}},{"type": "org.thingsboard.rule.engine.transform.TbTransformMsgNode","name": "下发","debugMode": true,"singletonMode": false,"queueName": null,"configurationVersion": 0,"configuration": {"scriptLang": "TBEL","jsScript": "msg.payload={\ntype: \"gpio_out\",\n body: {\n delay: 500,\n io: 0,\n value: 2\n }\n}\nvar msg1={method:\"no-reply\",params:msg,}\nmetadata.oneway=true;\nreturn {msg: msg1, metadata: metadata, msgType: \"RPC_CALL_FROM_SERVER_TO_DEVICE\"};","tbelScript": "msg.payload={\ntype: \"gpio_out\",\n body: {\n delay: 500,\n io: 0,\n value: 2\n }\n};\nmsg.name=\"gpio_out\";\nmsg.version=\"1.0\";\nvar decodedData = atob(msg.license); // decode the string\nif(decodedData.indexOf(\"无\")== -1){\nvar msg1={method:\"no-reply\",params:msg};\nmetadata.oneway=true;\nreturn {msg: msg1, metadata: metadata, msgType: \"RPC_CALL_FROM_SERVER_TO_DEVICE\"};\n}"},"additionalInfo": {"description": "","layoutX": 1074,"layoutY": 421}},{"type": "org.thingsboard.rule.engine.rpc.TbSendRPCRequestNode","name": "下发","debugMode": true,"singletonMode": false,"queueName": null,"configurationVersion": 0,"configuration": {"timeoutInSeconds": 60},"additionalInfo": {"description": "","layoutX": 1001,"layoutY": 655}},{"type": "org.thingsboard.rule.engine.filter.TbJsSwitchNode","name": "事件切换","debugMode": true,"singletonMode": false,"queueName": null,"configurationVersion": 0,"configuration": {"scriptLang": "TBEL","jsScript": "function nextRelation(metadata, msg) {\n    return ['one','nine'];\n}\nif(msgType === 'POST_TELEMETRY_REQUEST') {\n    return ['two'];\n}\nreturn nextRelation(metadata, msg);","tbelScript": "function nextRelation(metadata, msg) {\n    var arr=[];\n\nif(msg.eventType == \"1\") {\n    arr.push('车牌识别触发事件');\n \n}\nreturn arr;\n}\nreturn nextRelation(metadata, msg);"},"additionalInfo": {"description": "","layoutX": 1005,"layoutY": 197}}],"connections": [{"fromIndex": 0,"toIndex": 9,"type": "Success"},{"fromIndex": 2,"toIndex": 0,"type": "Post telemetry"},{"fromIndex": 2,"toIndex": 1,"type": "Post attributes"},{"fromIndex": 2,"toIndex": 3,"type": "RPC Request from Device"},{"fromIndex": 2,"toIndex": 4,"type": "Other"},{"fromIndex": 2,"toIndex": 5,"type": "RPC Request to Device"},{"fromIndex": 6,"toIndex": 2,"type": "Success"},{"fromIndex": 7,"toIndex": 8,"type": "Success"},{"fromIndex": 9,"toIndex": 7,"type": "车牌识别触发事件"}],"ruleChainConnections": null}
}

创建一个设备配置

设备配置规则链要用上面配置的规则链"臻识道闸设备配置"
image.png

臻识道闸设备配置这个名称不要写错,因为在网关gateway 的配置中
“deviceTypeJsonExpression”: “臻识道闸设备配置”, 是对应的deviceType的

配置道闸后台

首先要给道闸插网线,然后电脑和道闸在一个网络
登录道闸后台,道闸后台的地址在摄像头模组上有地址
1.在后台的高级设置>高级网络>mqtt配置
先配置mqtt broker

image.png

然后配置topic,注意这里只配置
道闸识别topic /device/message/up/ivs_result
下发控制io事件topic /设备id/device/message/down/gpio_out
image.png
开启抓拍图片上传mqtt,开启之后图片是通过道闸识别topic /device/message/up/ivs_result 进行base64上传 对应字段full_image_content

image.png

然后保存确定

测试

找一个车牌图片,打开道闸后台对准摄像头 按下模拟雷达开关触发
image.png

这个时候会自动创建一个设备
image.png
设备详情遥测
image.png

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/18568.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

气膜建筑:无硬件支撑的奇迹—轻空间

气膜建筑是一种创新的建筑形式&#xff0c;其独特之处在于其内部没有任何硬件支撑&#xff0c;仅靠空气吹起来。这种技术是如何实现的呢&#xff1f; 气膜结构的原理 气膜建筑的核心在于其充气结构。通过不断向气膜内部充入空气&#xff0c;气膜内部会维持一个较高的气压。这种…

最新微信发卡小程序 发卡网卡密系统流支持量主

2024.4更新 1.修复分类介绍报错 2.修改前端UI 3.增加插屏弹出广告 4.禁止PC端使用(PC端小程序没有广告) 免费下载&#xff1a;发卡小程序 卡密系统流支持量主 多种卡密领取模式【亲测】_麦田吧 前端演示地址&#xff1a;扫码查看 源码功能&#xff1a; 小程序系统/多种卡密领…

Excel单元格格式无法修改的原因与解决方法

Excel单元格格式无法更改可能由多种原因造成。以下是一些可能的原因及相应的解决方法&#xff1a; 单元格或工作表被保护&#xff1a; 如果单元格或工作表被设置为只读或保护状态&#xff0c;您将无法更改其中的格式。解决方法&#xff1a;取消单元格或工作表的保护。在Excel中…

LLC开关电源开发:第一节,LLC原理概述

第一节&#xff0c;LLC原理概述文章目录 一、LLC概述二、LLC电路拓扑1.电路拓扑2.电路工作原理3.电路原理分析 总结 一、LLC概述 LLC电路&#xff0c;是一种通过控制开关频率&#xff08;频率调节&#xff09;来实现输出电压恒定的谐振电路&#xff0c;它包括一个电感L、一个电…

001 仿muduo库实现高性能服务器组件_项目简介

​&#x1f308;个人主页&#xff1a;Fan_558 &#x1f525; 系列专栏&#xff1a;仿muduo &#x1f339;关注我&#x1f4aa;&#x1f3fb;带你学更多知识 文章目录 一、项目简介二、所需知识储备三、什么是muduo四、Reactor模式单Reactor单线程&#xff1a;单I/O多路复⽤业务…

C语言-02_变量与进制

文章目录 1.关键字2.标识符3.变量3.1 变量的声明与赋值3.2 变量的作用域3.3 变量按类型的分类 4.基本数据类型4.1 整数类型4.1.1 类型说明4.1.2 举例4.1.3 后缀4.1.4 整型的极限值 4.2 浮点类型4.2.1 类型说明4.2.2 举例 4.3 字符类型4.4 布尔类型 5.变量间的运算规则5.1 隐式类…

K8s证书过期处理

问题描述 本地有一个1master2worker的k8s集群&#xff0c;今天启动VMware虚拟机之后发现api-server没有起来&#xff0c;docker一直退出&#xff0c;这个集群是使用kubeadm安装的。 于是kubectl logs查看了日志&#xff0c;发现证书过期了 解决方案&#xff1a; 查看证书 #…

python数据处理中的类型检查与转换技巧

新书上架~&#x1f447;全国包邮奥~ python实用小工具开发教程http://pythontoolsteach.com/3 欢迎关注我&#x1f446;&#xff0c;收藏下次不迷路┗|&#xff40;O′|┛ 嗷~~ 目录 一、类型检查的重要性 二、类型检查与转换技巧 1. 识别数据类型不一致 2. 使用astype()方…

Epic Pen Pro v3 解锁版安装教程 (屏幕实时标记注释工具)

前言 Epic Pen是一款功能强大的屏幕标记工具&#xff0c;允许您在屏幕上绘图或书写&#xff0c;而无需在后台与软件交互。这意味着您几乎可以注释任何东西&#xff01;使用我们流行的屏幕标记和Windows数字白板工具Epic Pen编写、绘制和突出显示&#xff0c;包括演示文稿软件&…

ClickHouse数据管理与同步的关键技术

2024年 5 月 18 日&#xff0c;ClickHouse官方首届杭州 Meetup 活动成功举行。本次活动由 ClickHouse 和阿里云主办&#xff0c;NineData 和云数据库技术社区协办。围绕ClickHouse的核心技术、应用案例、最佳实践、数据管理、以及迁移同步等方面&#xff0c;和行业专家展开交流…

idea中快速找到当前git地址

idea中快速找到当前git地址 然后双击就可以看到地址了

Linux漏洞SSL/TLS协议信息泄露漏洞(CVE-2016-2183) - 非常危险(7.5分) 解决办法!升级openssl

漏洞情况 详细描述 TLS是安全传输层协议&#xff0c;用于在两个通信应用程序之间提供保密性和数据完整性。 TLS, SSH, IPSec协商及其他产品中使用的IDEA、DES及Triple DES密码或者3DES及 Triple 3DES存在大约四十亿块的生日界&#xff0c;这可使远程攻击者通过Sweet32攻击&…

2023-2024中国区块链年度发展报告

来源&#xff1a;赛迪 近期历史回顾&#xff1a;2024社交媒体全球使用趋势报告.pdf 国际建造成本指数报告2024--产能角逐.pdf 2024可持续包装管理体系与最佳实践案例集.pdf 2024年专利诉讼报告.pdf 2024Q1保险业运行报告.pdf 2024年云指数报告.pdf 2024内容营销10大趋势-内容时…

pytorch-池化层

目录 1. pooling池化层1.1 down sample2.2 Max pooling1.3 Avg pooling1.3 pooling pytorch实现 2. up sample上采样2.1 up sample2.2 pytorch实现 3. ReLU 1. pooling池化层 1.1 down sample 见下图&#xff0c;隔行隔列采样 2.2 Max pooling 下图采用2x2的filter&#x…

拉格朗日插值法的推导

1、插值的基本定义   设函数 y f ( x ) yf(x) yf(x)在区间 [ a , b ] [a,b] [a,b]上有定义&#xff0c;且已知它在 n 1 n1 n1个互异点 a ≤ x 0 < x 1 < . . . < x n ≤ b a\leq x_0<x_1<...<x_n\leq b a≤x0​<x1​<...<xn​≤b上的函数值 y 0 …

【Unity脚本】Unity中如何按类型查找游戏对象(GameObject)

【知识链】Unity -> 脚本系统 -> 访问游戏对象 -> 按类型访问游戏对象摘要&#xff1a;本文介绍了Unity中按类型查找游戏对象&#xff08;GameObject&#xff09;的五种方法&#xff0c;并提出了使用这些方法的最佳实践。 本文目录 一、访问游戏对象的方法二、如何按…

【个人博客搭建】(20)获取操作用户信息(IHttpContextAccessor)

IHttpContextAccessor在ASP.NET Core中扮演着至关重要的角色。它为开发者提供了一种方便的方式来访问和操作HttpContext对象&#xff0c;从而允许在整个应用程序中轻松地管理和使用HTTP请求和响应的相关信息。下面将深入探讨IHttpContextAccessor的作用、使用方法以及如何通过它…

[ue5]建模场景学习笔记(1)——混合材质

卷首&#xff1a;这部分会记录建模场景等相关学习内容&#xff0c;与ue引擎学习笔记不同的是&#xff0c;可能会略过一些基础内容&#xff0c;因为部分知识在blender中已经学习过了&#xff0c;不再继续记录。 1.需求分析&#xff1a; 想构建一个山地的场景&#xff0c;在ue5中…

解读vue3源码-1

提示&#xff1a;看到我 请让滚去学习 vue3渲染流程 文章目录 vue3渲染流程vue3的3个核心&#xff1a;1.响应式模块(Reactivity Module)--创建响应式数据2.编译模块(Compiler Module)--模版编译器将html转换为一个渲染函数3.渲染模块(Renderer Module) 渲染流程&#xff1a;1.首…

python办公自动化——(二)替换PPT文档中图形数据-柱图

效果: 数据替换前 &#xff1a; 替换数据后&#xff1a; 实现代码 import collections.abc from pptx import Presentation from pptx.util import Cm,Pt import pyodbc import pandas as pd from pptx.chart.data impo…