当前位置: 首页 > news >正文

海康视频播放,包含h5和web插件

自行下载
海康开放平台
在这里插入图片描述
demo 都写得很清楚,不多描述

1.视频web插件

在这里插入图片描述

vue2写法,公共vue文件写法,调用文件即可

开始时需要以下配置,不知道的找对接平台数据的人,必须要,否则播不了

getParameterData: {port: 443,ip: "10.10.1.12",appKey: "20294202",appSecret: "ndqCAFyke4t1jHY2r8Uy",enableHTTPS: 1,
}, //海康数据
<!-- 海康插件组件 -->
<template><div class="video-center" ref="videoCenter"><div :id="playWnd" class="playWnd"></div></div></template><script>const control = require("../video/jsWebControl-1.0.0.min.js");const jsencrypt = require("../video/jsencrypt.min.js");export default {data() {return {oWebControl: null,pubKey: "",initCount: 0,w: 0,h: 0,winId: 1,};},props: {playWnd: {type: String,default: 'playWnd',},//播放类型  0预览 1回放playMode: {type: Number,default: 0,},//初始化数据initData: {type: Object,default() {return {enableHttps: 1,encryptedFields: "secret",layout: "1x1",btIds: "0,16,256,257,258,259,260,512,513,514,515,516,517,768,769",showSmart: 1,showToolbar: 1,snapDir: "D:\\SnapDir",videoDir: "D:\\VideoDir",};},},},created: function () {this.initPlugin();},mounted: function () {this.$nextTick(()=>{this.h = this.$refs["videoCenter"].clientHeight;this.w = this.$refs["videoCenter"].clientWidth;})window.addEventListener("resize",() => {if (this.$refs["videoCenter"]) {this.h = this.$refs["videoCenter"].clientHeight;this.w = this.$refs["videoCenter"].clientWidth;this.resetFun();}});},computed: {},methods: {// 设置窗口裁剪,当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口setWndCover() {var iWidth = window.width;var iHeight = window.height;var oDivRect = document.querySelector("#"+this.playWnd).getBoundingClientRect();var iCoverLeft = oDivRect.left < 0 ? Math.abs(oDivRect.left) : 0;var iCoverTop = oDivRect.top < 0 ? Math.abs(oDivRect.top) : 0;var iCoverRight =oDivRect.right - iWidth > 0? Math.round(oDivRect.right - iWidth): 0;var iCoverBottom =oDivRect.bottom - iHeight > 0? Math.round(oDivRect.bottom - iHeight): 0;iCoverLeft = iCoverLeft > this.w ? this.w : iCoverLeft;iCoverTop = iCoverTop > this.h ? this.h : iCoverTop;iCoverRight = iCoverRight > this.w ? this.w : iCoverRight;iCoverBottom = iCoverBottom > this.h ? this.h : iCoverBottom;this.oWebControl.JS_RepairPartWindow(0, 0, this.w + 1, this.h); // 多1个像素点防止还原后边界缺失一个像素条if (iCoverLeft != 0) {this.oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, this.h);}if (iCoverTop != 0) {this.oWebControl.JS_CuttingPartWindow(0,0,this.w + 1,iCoverTop); // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条}if (iCoverRight != 0) {this.oWebControl.JS_CuttingPartWindow(this.w - iCoverRight,0,iCoverRight,this.h);}if (iCoverBottom != 0) {this.oWebControl.JS_CuttingPartWindow(0,this.h - iCoverBottom,this.w,iCoverBottom);}},// 初始化init() {this.getPubKey(() => {let { appSecret, ...hkData } = this.$store.state.getParameterData;//海康提供的认证信息this.oWebControl.JS_RequestInterface({funcName: "init",argument: JSON.stringify({appkey: hkData.appKey,                            //API网关提供的appkeysecret: this.setEncrypt(appSecret),            //API网关提供的secretip: hkData.ip,                                    //API网关IP地址playMode: this.playMode,                        //播放模式(决定显示预览还是回放界面)port: hkData.port,                                //端口snapDir: this.initData.snapDir,                    //抓图存储路径videoDir: this.initData.videoDir,                      //紧急录像或录像剪辑存储路径layout: this.initData.layout,                    //布局enableHTTPS: hkData.enableHTTPS,                  //是否启用HTTPS协议encryptedFields: this.initData.encryptedFields,          //加密字段showToolbar: this.initData.showToolbar,                  //是否显示工具栏showSmart: this.initData.showSmart,                      //是否显示智能信息})}).then((oData) => {// 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题this.oWebControl.JS_Resize(this.w, this.h);});});},/* 视频预览业务功能 */startPreviewFun(val) {this.oWebControl.JS_RequestInterface({funcName: "startPreview",argument: JSON.stringify({cameraIndexCode: val,streamMode: 0,transMode: 1,gpuMode: 0,wndId: this.winId,}),}).then((oData) => {console.log('播放成功',oData)});},/* 视频回放业务功能 */startPlaybackFun(val, start, end, streamMode = 1) {this.oWebControl.JS_RequestInterface({funcName: "startPlayback",argument: JSON.stringify({cameraIndexCode: val,                   //监控点编号startTimeStamp: start,  //录像查询开始时间戳,单位:秒endTimeStamp: end,      //录像结束开始时间戳,单位:秒streamMode: streamMode,recordLocation: 0,                     //录像存储类型:0-中心存储,1-设备存储transMode: 1,                               //传输协议:0-UDP,1-TCPgpuMode: 0,                                   //是否启用GPU硬解,0-不启用,1-启用wndId: this.wndId                                     //可指定播放窗口})}).then((oData) => {console.log('回放',oData)});},// RSA加密setEncrypt(value) {var encrypt = new jsencrypt.JSEncrypt();encrypt.setPublicKey(this.pubKey);return encrypt.encrypt(value);},// 推送消息cbIntegrationCallBack(oData) {// 窗口选中if (oData.responseMsg.type === 1) {this.winId = oData.responseMsg.msg.wndId}},// 设置窗口控制回调setCallbacks() {this.oWebControl.JS_SetWindowControlCallback({cbIntegrationCallBack: this.cbIntegrationCallBack,});},/* 获取公钥 */getPubKey(callback) {this.oWebControl.JS_RequestInterface({funcName: "getRSAPubKey",argument: JSON.stringify({keyLength: 1024,}),}).then((oData) => {if (oData.responseMsg.data) {this.pubKey = oData.responseMsg.data;callback();}});},// 加载插件initPlugin() {let _this = this;this.oWebControl = new control.WebControl({szPluginContainer: this.playWnd,iServicePortStart: 15900,iServicePortEnd: 15909,szClassId: "23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 用于IE10使用ActiveX的clsidcbConnectSuccess: function () {_this.setCallbacks();_this.oWebControl.JS_StartService("window", { dllPath: "./VideoPluginConnect.dll"}).then(() => {_this.oWebControl.JS_CreateWnd(_this.playWnd, _this.w, _this.h).then(() => {_this.init();});},function () {});},cbConnectError: function () {_this.oWebControl = null;initCount ++;if (initCount < 3) {                             setTimeout(function () {initPlugin();}, 3000)} else {console.log('插件启动失败,请检查插件是否安装!')}},cbConnectClose: function (bNormalClose) {console.log("cbConnectClose");_this.oWebControl = null;},});},// 重置窗口大小resetFun() {if (this.oWebControl != null) {this.oWebControl.JS_Resize(this.w, this.h);this.setWndCover();}},},destroyed() {this.oWebControl.JS_HideWnd();this.oWebControl.JS_DestroyWnd().then(function () {console.log("销毁插件窗口成功");},function () {console.log("销毁插件窗口失败");});},};</script><style scoped="scoped">.video-center {width: 100%;height: 100%;}</style>

不完整,自行补充

<template><PreviewVideoref="webVideo":playMode="0":initData="initData"/>
</template>
<script>
export default {data() {return {initData: {enableHttps: 0,encryptedFields: "secret",layout: "2x2", // 4个窗口showSmart: 1,showToolbar: 1,snapDir: "D:SnapDir",videoDir: "D:VideoDir",},}},method () {//播放时调用videoPlayFun() {//预览//第三方标识,由海康提供,后端传回this.$refs['webVideo'].startPreviewFun(data.deviceNameEn)//回放,需要回放时间,若使用element的时间戳,需要/1000,变为秒单位//playMode传1this.$refs['webVideo'].startPlaybackFun(data.deviceNameEn,startTime,endTime)}}
}
</script>
vue3+vite

playVideo传第三方标识,请自行修改以下变量值如上
可直接复制使用vue,点击播放
能直接使用,测试如下,可测试第三方标识能否使用
在这里插入图片描述

在这里插入图片描述

<template><div class="video-center" ref="videoCenter"><div @click="playVideo('1005ede4f95a4447897b8fd1fa8cd6f7', 1)">"1005ede4f95a4447897b8fd1fa8cd6f7"</div><div @click="playVideo('933d67747cb248ba93e0a65b5ac751ac', 2)">"933d67747cb248ba93e0a65b5ac751ac"</div><div @click="playVideo('e77fa1c7d9f04c9b893a74d441d5a53b', 3)">"e77fa1c7d9f04c9b893a74d441d5a53b"</div><div id="playWnd" class="playWnd"></div></div>
</template>
<script setup lang="ts">
import { onMounted, ref, reactive, unref } from 'vue'
var initCount = 0;
var oWebControl = null
var pubKey = '';
// 创建播放实例
const initPlugin = () => {oWebControl = new WebControl({szPluginContainer: "playWnd",                       // 指定容器idiServicePortStart: 15900,                           // 指定起止端口号,建议使用该值iServicePortEnd: 15900,                             szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11",   // 用于IE10使用ActiveX的clsidcbConnectSuccess: function () {                     // 创建WebControl实例成功											oWebControl.JS_StartService("window", {         // WebControl实例创建成功后需要启动服务dllPath: "./VideoPluginConnect.dll"         // 值"./VideoPluginConnect.dll"写死 }).then(function () {                           // 启动插件服务成功oWebControl.JS_SetWindowControlCallback({   // 设置消息回调cbIntegrationCallBack: cbIntegrationCallBack});oWebControl.JS_CreateWnd("playWnd", 1000, 600).then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定init();  // 创建播放实例成功后初始化});}, function () { // 启动插件服务失败});},cbConnectError: function () { // 创建WebControl实例失败oWebControl = null;WebControl.JS_WakeUp("VideoWebPlugin://"); // 程序未启动时执行error函数,采用wakeup来启动程序initCount ++;if (initCount < 3) {                             setTimeout(function () {initPlugin();}, 3000)} else {console.log('插件启动失败,请检查插件是否安装!')// $("#playWnd").html("插件启动失败,请检查插件是否安装!");}},cbConnectClose: function (bNormalClose) {            // 异常断开:bNormalClose = false// JS_Disconnect正常断开:bNormalClose = true	console.log("cbConnectClose");oWebControl = null;console.log('插件未启动,正在尝试启动,请稍候...')// $("#playWnd").html("插件未启动,正在尝试启动,请稍候...");WebControl.JS_WakeUp("VideoWebPlugin://");initCount ++;if (initCount < 3) {setTimeout(function () {initPlugin();}, 3000)} else {console.log('插件启动失败,请检查插件是否安装!')// $("#playWnd").html("插件启动失败,请检查插件是否安装!");}	}});
}
// 推送消息
const cbIntegrationCallBack = (oData) => {console.log(JSON.stringify(oData.responseMsg))
}
const init = () => {getPubKey(function () {// 请自行修改以下变量值			var appkey = "20294202";                           //综合安防管理平台提供的appkey,必填var secret = setEncrypt("ndqCAFyke4t1jHY2r8Uy");   //综合安防管理平台提供的secret,必填var ip = "10.10.1.12";                           //综合安防管理平台IP地址,必填var playMode = 0;                                  //初始播放模式:0-预览,1-回放var port = 443;                                    //综合安防管理平台端口,若启用HTTPS协议,默认443var snapDir = "D:\\SnapDir";                       //抓图存储路径var videoDir = "D:\\VideoDir";                     //紧急录像或录像剪辑存储路径var layout = "2x2";                                //playMode指定模式的布局var enableHTTPS = 1;                               //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1var encryptedFields = 'secret';					   //加密字段,默认加密领域为secretvar showToolbar = 1;                               //是否显示工具栏,0-不显示,非0-显示var showSmart = 1;                                 //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示var buttonIDs = "0,16,256,257,258,259,260,512,513,514,515,516,517,768,769";  //自定义工具条按钮// 请自行修改以上变量值	oWebControl.JS_RequestInterface({funcName: "init",argument: JSON.stringify({appkey: appkey,                            //API网关提供的appkeysecret: secret,                            //API网关提供的secretip: ip,                                    //API网关IP地址playMode: playMode,                        //播放模式(决定显示预览还是回放界面)port: port,                                //端口snapDir: snapDir,                          //抓图存储路径videoDir: videoDir,                        //紧急录像或录像剪辑存储路径layout: layout,                            //布局enableHTTPS: enableHTTPS,                  //是否启用HTTPS协议encryptedFields: encryptedFields,          //加密字段showToolbar: showToolbar,                  //是否显示工具栏showSmart: showSmart,                      //是否显示智能信息buttonIDs: buttonIDs                       //自定义工具条按钮})}).then(function (oData) {oWebControl.JS_Resize(1000, 600);  // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题});});
}//获取公钥
const getPubKey = (callback) => {oWebControl.JS_RequestInterface({funcName: "getRSAPubKey",argument: JSON.stringify({keyLength: 1024})}).then(function (oData) {console.log(oData);if (oData.responseMsg.data) {pubKey = oData.responseMsg.data;callback()}})
}//RSA加密
const setEncrypt = (value) => {var encrypt = new JSEncrypt();encrypt.setPublicKey(pubKey);return encrypt.encrypt(value);
}
onMounted(() => {initPlugin()window.addEventListener('unload', () => {if (oWebControl != null){oWebControl.JS_HideWnd();}})window.addEventListener('resize', () => {if (oWebControl != null) {oWebControl.JS_Resize(1000, 600);setWndCover();}})window.addEventListener('scroll', () => {if (oWebControl != null) {oWebControl.JS_Resize(1000, 600);setWndCover();}})
})
const setWndCover = () => {var iWidth = window.innerWidth;var iHeight = window.innerHeight;var oDivRect = document.querySelector("#playWnd").getBoundingClientRect();console.log('oDivRect', oDivRect)var iCoverLeft = (oDivRect.left < 0) ? Math.abs(oDivRect.left): 0;var iCoverTop = (oDivRect.top < 0) ? Math.abs(oDivRect.top): 0;var iCoverRight = (oDivRect.right - iWidth > 0) ? Math.round(oDivRect.right - iWidth) : 0;var iCoverBottom = (oDivRect.bottom - iHeight > 0) ? Math.round(oDivRect.bottom - iHeight) : 0;iCoverLeft = (iCoverLeft > 1000) ? 1000 : iCoverLeft;iCoverTop = (iCoverTop > 600) ? 600 : iCoverTop;iCoverRight = (iCoverRight > 1000) ? 1000 : iCoverRight;iCoverBottom = (iCoverBottom > 600) ? 600 : iCoverBottom;oWebControl.JS_RepairPartWindow(0, 0, 1001, 600);    // 多1个像素点防止还原后边界缺失一个像素条if (iCoverLeft != 0) {oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, 600);}if (iCoverTop != 0) {oWebControl.JS_CuttingPartWindow(0, 0, 1001, iCoverTop);    // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条}if (iCoverRight != 0) {oWebControl.JS_CuttingPartWindow(1000 - iCoverRight, 0, iCoverRight, 600);}if (iCoverBottom != 0) {oWebControl.JS_CuttingPartWindow(0, 600 - iCoverBottom, 1000, iCoverBottom);}
}
const playVideo = (val:string, i) => {oWebControl.JS_RequestInterface({funcName: "startPreview",argument: JSON.stringify({cameraIndexCode:val,                //监控点编号streamMode: 0,                         //主子码流标识transMode: 1,                           //传输协议gpuMode: 0,                               //是否开启GPU硬解wndId:  i                                    //可指定播放窗口})})
}</script>
<style>.playWnd {width: 1000px;                  /*播放容器的宽和高设定*/height: 600px;border: 1px solid red;}
</style>

2.H5视频播放器

vue3写法,将下载的文件复制到public下
在index.html 引入

<script src="/js/h5player.min.js"></script>

在这里插入图片描述

<!-- 海康插件 -->
<template><div :id="props.playId" class="w-full"></div>
</template>
<script setup lang="ts">
const message = useMessage() // 消息弹窗
const props = defineProps({playId: {require: true,type: String,default: () => {return 'player'}}
})
const player = ref()
onMounted(() => {initPlayer()// 设置播放容器的宽高并监听窗口大小变化window.addEventListener('resize', () => {player.value.JS_Resize()})
})
const emit = defineEmits(['error'])
const initPlayer = () => {// @ts-ignoreplayer.value = new JSPlugin({szId: props.playId,szBasePath: '/js',bSupporDoubleClickFull: true,// 当容器div#play_window有固定宽高时,可不传iWidth和iHeight,窗口大小将自适应容器宽高// iWidth: props.iWidth,// iHeight: props.iHeight,// 分屏播放,默认最大分屏4*4iMaxSplit: 4,iCurrentSplit: 1})// 事件回调绑定player.value.JS_SetWindowControlCallback({//插件选中窗口回调windowEventSelect: (iWndIndex) => {console.log('windowSelect callback: ', iWndIndex)wndIndex.value = iWndIndex},// @ts-ignore 取流失败,流中断等错误都会触发该回调函数pluginErrorHandler: (index, iErrorCode, oError) => {// 取流失败if (iErrorCode === '0x12f910011') emit('error')}})
}
const wndIndex = ref(0)
const createPlayer = (url: string, i = wndIndex.value) => {console.log('视频流地址:', url, props.playId)if (!url) returnplayer.value.JS_Play(url, { playURL: url, mode: 0 }, i).then(() => {console.log('play success=============')},(err) => {// message.warning('播放失败!')console.info('JS_Play failed:', err)})
}
// 分屏
const splitPlayer = (num) => {if (num === 1) wndIndex.value = 0player.value.JS_ArrangeWindow(num)
}
// 全屏
const fullScreen = (isFull) => {player.value.JS_FullScreenDisplay(isFull)
}
// 回放
const replayFun = (data) => {player.value.JS_Play(data.url, { playURL: data.url, mode: 0 }, 0, data.startTime, data.endTime).then(() => {console.log('playbackStart success')},(err) => {console.info('JS_Play failed:', err)})
}
// 设置窗口大小
const resizeFun = (iWidth, iHeight) => {player.value.JS_Resize(iWidth, iHeight)
}
const stopAllPlay = () => {player.value.JS_StopRealPlayAll().then(() => {console.info('JS_StopRealPlayAll success')})
}
const playerFun = {createPlayer,splitPlayer,fullScreen,replayFun,resizeFun,stopAllPlay
}
defineExpose({ playerFun })
</script>

不完整,自行补充

 <player class="w-full h-400px" ref="playRef" />

在这里插入图片描述
这是我本地的地址,需要后端返回类似的
ws和hls都试过可以播放,ws基本没延迟,优先使用

 unref(playRef).playerFun.createPlayer(item, index)回放时间格式要转为 format('YYYY-MM-DDTHH:mm:ss.SSSZ')unref(playRef).playerFun.replayFun({ ... })

相关文章:

海康视频播放,包含h5和web插件

自行下载 海康开放平台 demo 都写得很清楚&#xff0c;不多描述 1.视频web插件 vue2写法&#xff0c;公共vue文件写法&#xff0c;调用文件即可 开始时需要以下配置&#xff0c;不知道的找对接平台数据的人&#xff0c;必须要&#xff0c;否则播不了 getParameterData: {po…...

数据库-python SQLite3

数据库-python SQLite3 一&#xff1a;sqlite3 简介二: sqlite3 流程1> demo2> sqlite3 流程 三&#xff1a;sqlite3 step1> create table2> insert into3> update4> select1. fetchall()2. fetchone()3. fetchmany() 5> delete6> other step 四&#…...

FFMpeg rtmp 推送本地yuv文件

可以借鉴的&#xff1a;C使用FFmpeg实现YUV数据编码转视频文件_C 语言_脚本之家 yuv文件下载地址&#xff1a;YUV Sequences 代码&#xff1a; #include <stdio.h> #include <unistd.h> #include <iostream> extern "C" { #include "libav…...

websocket使用,spring boot + vite + vue3

websocket使用&#xff0c;spring boot vite vue3 Websocket是什么WebSocket 服务端构建websocket 服务实现处理器pom文件 客户端仓库地址 Websocket是什么 WebSocket 是一种网络传输协议&#xff0c;可在单个 TCP 连接上进行全双工通信&#xff0c;位于 OSI 模型的应用层。…...

基础位运算

基础知识点&#xff1a; 1.判断2的幂 n&&#xff08;n-1&#xff09;0 2.每次减一处理 n&(n-1) 3.判断出现1次次数的数 x^0x&#xff0c;x^x0&#xff0c;a^bc则ab^c&#xff0c;ba^c 力扣练习题&#xff1a; 136.只出现一次的数字 class Solution { public:int si…...

性价比高真无线蓝牙耳机有哪些?性价比真无线蓝牙耳机推荐

目前真无线蓝牙耳机的音质和性能已经越来越接近甚至超越传统有线耳机。然而&#xff0c;市面上的TWS耳机品牌和型号繁多&#xff0c;价格也从几十元到几千元不等&#xff0c;性价比自然成了消费者选择时的重要考量因素&#xff0c;究竟哪些真无线蓝牙耳机既能够提供满意的音质和…...

Big Data Tools插件

一些介绍 在Jetbrains的产品中&#xff0c;均可以安装插件&#xff0c;其中&#xff1a;Big Data Tools插件可以帮助我们方便的操作HDFS&#xff0c;比如 IntelliJ IDEA&#xff08;Java IDE&#xff09; PyCharm&#xff08;Python IDE&#xff09; DataGrip&#xff08;SQL …...

两个li标签之间有空格这是什么原因

<li> 标签之间出现的空格可能由多种原因造成。以下是一些常见的原因&#xff1a; HTML源代码中的空格&#xff1a;如果你在HTML源代码中直接在两个 <li> 标签之间输入了空格或制表符&#xff08;Tab&#xff09;&#xff0c;这些空格可能会被浏览器渲染出来。不过&…...

使用Colly库进行高效的网络爬虫开发

引言 随着互联网技术的飞速发展&#xff0c;网络数据已成为信息获取的重要来源。网络爬虫作为自动获取网页内容的工具&#xff0c;在数据分析、市场研究、信息聚合等领域发挥着重要作用。本文将介绍如何使用Go语言中的Colly库来开发高效的网络爬虫。 什么是Colly库&#xff1…...

【C#】制作图集

如题目&#xff0c;用好几个图片拼在一个大图里&#xff0c;博主是用于Unity游戏开发使用的&#xff0c;话不多说&#xff0c;上代码&#xff01; using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging;namespace EffectsPac…...

行列视报表系统制作的报表与厂级监控信息系统(SIS)系统中的报表有什么区别?

厂级监控信息系统是集过程实时监测、优化控制及生产过程管理为一体的厂级自动化信息系统&#xff0c;是处于DCS以及相关辅助程控系统与全厂管理信息系统之间的一套实时厂级监控信息系统&#xff0c;该产品也是本公司的一套独立产品。 SIS系统中的报表只是其中的一个模块&#…...

算法08 广/宽度优先搜索及相关问题详解

这是《C算法宝典》算法篇的第08节文章啦~ 如果你之前没有太多C基础&#xff0c;请点击&#x1f449;专栏&#xff1a;C语法入门&#xff0c;如果你C语法基础已经炉火纯青&#xff0c;则可以进阶算法&#x1f449;专栏&#xff1a;算法知识和数据结构&#x1f449;专栏&#xff…...

PyTorch 版本与 CUDA 版本的兼容性示例

PyTorch 1.9.0 及以上版本支持 CUDA 11.1。PyTorch 1.8.0 支持 CUDA 11.0。PyTorch 1.7.0 支持 CUDA 10.2。PyTorch 1.6.0 支持 CUDA 10.1。PyTorch 1.5.0 支持 CUDA 10.1。PyTorch 1.4.0 支持 CUDA 10.1。PyTorch 1.3.0 支持 CUDA 10.0。PyTorch 1.2.0 支持 CUDA 9.2。PyTorch…...

Selenium进行Web自动化滚动

在使用Selenium进行Web自动化时&#xff0c;计算页面内的滚动条位置或执行滚动操作通常涉及JavaScript执行。Selenium的WebDriver提供了执行JavaScript代码的功能&#xff0c;这可以用来获取滚动条的位置或滚动到页面上的特定位置。 获取滚动条位置 你可以使用JavaScript的wi…...

机器学习模型训练过程和预测过程 用孩子来生动的比喻 --九五小庞

训练过程&#xff1a;孩子在学习知识 想象一下&#xff0c;一个年幼的孩子刚开始学习新知识&#xff0c;这就像是机器学习的模型训练过程。 收集教材&#xff1a;孩子首先得到了一本教科书或一系列学习材料&#xff0c;这些材料就像机器学习中的数据集&#xff0c;包含了各种…...

【爱上C++】详解string类2:模拟实现、深浅拷贝

在上一篇文章中我们介绍了string类的基本使用&#xff0c;本篇文章我们将讲解string类一些常用的模拟实现&#xff0c;其中有很多细小的知识点值得我们深入学习。Let’s go&#xff01; 文章目录 类声明默认成员函数构造函数析构函数拷贝构造函数深浅拷贝问题传统写法现代写法…...

狄克斯特拉算法

狄克斯特拉算法&#xff08;Dijkstra’s algorithm&#xff09;是一种用于在带权图中找到从单一源点到所有其他顶点的最短路径的算法。它适用于处理带有非负权值的图。 下面将详细解释算法的工作原理、时间复杂度以及如何通过优化数据结构来改进其性能。 狄克斯特拉算法的工作…...

2024推荐整理几个磁力导航网站可提供海量资源的

都2024现在网上找资源像流水得鱼一样&#xff0c;抓一大把结果很难吃&#xff0c;我通宵特意整理的网站&#xff0c;网上有许多磁力导航网站可以提供海量的磁力链接资源&#xff0c;以下是一些有效的磁力导航网站推荐&#xff1a; 磁力搜索 链接&#xff1a; 资源类型&#x…...

链式访问:C语言中的函数调用技巧

链式访问&#xff1a;C语言中的函数调用技巧 在C语言编程中&#xff0c;链式访问&#xff08;chained calls&#xff09;是一个常见的编程技巧&#xff0c;它允许你在一行代码中连续调用多个函数或方法。这种技巧不仅能够让代码更加简洁和易读&#xff0c;还能减少临时变量的使…...

数据库设计(实战项目)-1个手机号多用户身份

一. 背景&#xff1a; 该需求是一个互联网医院的预约单场景&#xff0c;护士在小程序上申请患者查房预约单&#xff0c;医生在小程序上对预约单进行接单&#xff0c;护士开始查房后填写查房小结&#xff0c;客户需要对用户信息进行授权&#xff0c;医生查房后进行签字&#xff…...

优盈杯数据泄露事件复盘:隐私保护的警钟

300 万张照片泄露&#xff1a;优盈杯隐私防线的崩塌2014 年 9 月&#xff0c;Clarifai 公司首席执行官向优盈杯一位创始人发邮件&#xff0c;请求提供大量优盈杯照片数据集。由于优盈杯部分创始人对 Clarifai 有投资&#xff0c;Humor Rainbow 为其提供了近 300 万张 优盈杯用户…...

FastDDS XML配置实战:从HelloWorld到可配置QoS的完整迁移指南

FastDDS XML配置实战&#xff1a;从硬编码到灵活部署的工程化演进 在分布式系统开发中&#xff0c;数据分发服务(DDS)因其高效的实时通信能力被广泛应用于工业物联网、自动驾驶等领域。作为DDS规范的实现之一&#xff0c;FastDDS凭借其出色的性能和灵活性赢得了开发者青睐。本…...

intv_ai_mk11快速上手:浏览器输入URL→发送‘帮我写周报’→获得带数据亮点的Word格式草稿

intv_ai_mk11快速上手&#xff1a;浏览器输入URL→发送帮我写周报→获得带数据亮点的Word格式草稿 1. 什么是intv_ai_mk11 intv_ai_mk11是一款基于Llama架构的AI对话助手&#xff0c;拥有7B参数规模&#xff0c;运行在GPU服务器上。它能像真人助手一样理解你的需求&#xff0…...

通义千问1.5-1.8B-Chat-GPTQ-Int4实战:微信小程序集成AI对话功能开发指南

通义千问1.5-1.8B-Chat-GPTQ-Int4实战&#xff1a;微信小程序集成AI对话功能开发指南 最近在做一个宠物社区的小程序&#xff0c;想加个智能客服功能&#xff0c;让用户能随时问问养宠问题。一开始觉得这事儿挺复杂&#xff0c;得自己搞个大模型服务器&#xff0c;成本高不说&…...

Krita AI Diffusion IP-Adapter功能异常深度排查与解决方案

Krita AI Diffusion IP-Adapter功能异常深度排查与解决方案 【免费下载链接】krita-ai-diffusion Streamlined interface for generating images with AI in Krita. Inpaint and outpaint with optional text prompt, no tweaking required. 项目地址: https://gitcode.com/g…...

如何彻底解决ComfyUI-Manager安装难题:终极完整指南

如何彻底解决ComfyUI-Manager安装难题&#xff1a;终极完整指南 【免费下载链接】ComfyUI-Manager ComfyUI-Manager is an extension designed to enhance the usability of ComfyUI. It offers management functions to install, remove, disable, and enable various custom …...

保姆级教程:YOLOv8轻量化模型从训练到安卓部署全流程(附避坑指南)

保姆级教程&#xff1a;YOLOv8轻量化模型从训练到安卓部署全流程&#xff08;附避坑指南&#xff09; 在移动端实现实时目标检测一直是计算机视觉领域的热门方向。YOLOv8作为当前最先进的检测模型之一&#xff0c;其轻量化版本在安卓设备上的部署需求日益增长。本文将手把手带…...

2026 Global Ion Exchange Resin Systems Market Trends:关税扰动下的工程水处理系统重构与产业链迁移逻辑

观点 离子交换树脂系统的竞争核心&#xff0c;已经不再是“树脂材料”&#xff0c;而是“系统工程能力 供应链组织能力”。 2026年关税变量的加入&#xff0c;本质上正在把这个行业从“化工材料赛道”&#xff0c;推向“工程系统全球制造网络”的复合竞争阶段。一、这不是树脂…...

灵毓秀-牧神-造相Z-Turbo使用全攻略:从环境检查到作品输出

灵毓秀-牧神-造相Z-Turbo使用全攻略&#xff1a;从环境检查到作品输出 1. 镜像简介与核心功能 灵毓秀-牧神-造相Z-Turbo是一款基于Xinference部署的AI文生图模型服务&#xff0c;专门用于生成《牧神记》中灵毓秀角色的高质量图像。该镜像集成了Gradio交互界面&#xff0c;让用…...

Linux服务器日志爆满?5个实用命令快速定位并清理大日志文件

Linux服务器日志爆满&#xff1f;5个实用命令快速定位并清理大日志文件 当服务器磁盘空间告急时&#xff0c;日志文件往往是罪魁祸首。作为系统管理员&#xff0c;我们需要快速定位问题并安全清理&#xff0c;避免服务中断。本文将分享5个核心命令的组合使用技巧&#xff0c;帮…...