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

wordpress 留言表单关于公司网络优化方案

wordpress 留言表单,关于公司网络优化方案,北海做网站公司,网站型跟商城型1 换源 仅适用于Release date: May 3rd 2023、Debian version: 11 (bullseye)这个树莓派OS版本#xff0c;其他版本不保证有效。 首先使用如下命令#xff0c;查看自己树莓派的架构。 uname -a结果如下#xff1a; 如果红圈处显示为aarch64#xff0c;使用命令sudo na…1 换源 仅适用于Release date: May 3rd 2023、Debian version: 11 (bullseye)这个树莓派OS版本其他版本不保证有效。 首先使用如下命令查看自己树莓派的架构。 uname -a结果如下 如果红圈处显示为aarch64使用命令sudo nano /etc/apt/sources.list注释掉里面的所有内容加入以下内容 # 默认注释了源码镜像以提高 apt update 速度如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free# deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free # # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-freedeb https://security.debian.org/debian-security bullseye-security main contrib non-free # deb-src https://security.debian.org/debian-security bullseye-security main contrib non-free然后保存。 如果红圈处显示armv7l则使用命令sudo nano /etc/apt/sources.list注释掉里面的所有内容加入以下内容 deb https://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bullseye main non-free contrib rpi # deb-src https://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bullseye main non-free contrib rpi# deb [archarm64] https://mirrors.tuna.tsinghua.edu.cn/raspbian/multiarch/ bullseye main注意两者不可同时选择。 做完上述步骤后使用命令sudo nano /etc/apt/sources.list.d/raspi.list 注释掉里面的所有内容输入以下内容 deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main然后保存。 执行sudo apt-get update. 2 安装OpenCV 使用命令sudo apt-get install python-opencv -y安装OpenCV。 3 编写代码 在/home/pi下创建project文件夹在该文件夹中再创建文件夹中创建img文件夹、code.py文件。 在code.py文件中写入以下内容 # -*- codingutf-8 import time import datetime #日期时间 import os #文件操作 import cv2 #opencv-python from qcloud_cos import CosConfig from qcloud_cos import CosS3Client import sys import os import logging# 正常情况日志级别使用 INFO需要定位时可以修改为 DEBUG此时 SDK 会打印和服务端的通信信息 logging.basicConfig(levellogging.INFO, streamsys.stdout)# 1. 设置用户属性, 包括 secret_id, secret_key, region等。Appid 已在 CosConfig 中移除请在参数 Bucket 中带Appid。Bucket 由 BucketName-Appid 组成 secret_id 你的ID # 用户的 SecretId建议使用子账号密钥授权遵循最小权限指引降低使用风险。子账号密钥获取可参见 https://cloud.tencent.com/document/product/598/37140 secret_key 你的key # 用户的 SecretKey建议使用子账号密钥授权遵循最小权限指引降低使用风险。子账号密钥获取可参见 https://cloud.tencent.com/document/product/598/37140 region ap-guangzhou # 替换为用户的 region已创建桶归属的 region 可以在控制台查https://console.cloud.tencent.com/cos5/bucket# COS 支持的所有 region 列表参见 https://cloud.tencent.com/document/product/436/6224 token None # 如果使用永久密钥不需要填入 token如果使用临时密钥需要填入临时密钥生成和使用指引参见 https://cloud.tencent.com/document/product/436/14048 scheme https # 指定使用 http/https 协议来访问 COS默认为 https可不填config CosConfig(Regionregion, SecretIdsecret_id, SecretKeysecret_key, Tokentoken, Schemescheme) client CosS3Client(config)camera cv2.VideoCapture(0) #一个摄像头后期可扩展多个摄像头def delete_imgs():delete_url /home/pi/project/imgdelete_list os.listdir(delete_url)#print(delete_list)for i in range(len(delete_list)):os.remove(delete_url/delete_list[i])logging.info(delete all imgs success!)if camera.isOpened():logging.info(Start Picture!)while True:# 设置分辨率camera.set(3, 1920) #widthcamera.set(4, 1080) #heightret, img camera.read()date datetime.datetime.now().strftime(%Y-%m-%d)get_photo_time datetime.datetime.now().strftime(%Y-%m-%d_%H-%M-%S)#print(get_photo_time)file_path /home/pi/regular-photos-of-raspberry-pie/img/ str(get_photo_time) .jpgcv2.imwrite(file_path,img) #保存到树莓派本地upload_time datetime.datetime.now().strftime(%Y-%m-%d_%H-%M-%S)#print(upload_time)response client.upload_file(Bucketraspberry1-1257204660,LocalFilePathfile_path,KeygetRasberryImgs/ date / str(upload_time) .jpg,PartSize1,MAXThread10,EnableMD5False)os.remove(file_path) #删除树莓派本地已保存文件//有时候因为进程先后有些图片文件来不及删除#判断img文件中有没有照片删除掉nums os.listdir(/home/pi/regular-photos-of-raspberry-pie/img)#删除来不及删除的照片if nums:delete_imgs()# camera.release()time.sleep(3600)执行上述代码即可完成每小时拍一张照并上传到腾讯云对象存储COS中。 参考资料 https://blog.csdn.net/weixin_46709801/article/details/128045344
http://www.zqtcl.cn/news/209683/

相关文章:

  • 极速网站建设定制价格微信公众号运营助手
  • .net制作网站开发教程在线修图编辑器
  • 哪些网站可以做详情页聊城高新区建设局网站
  • 湖南网站优化代运营山东建设厅证件查询网址
  • 以百度云做网站空间浙江外贸网站建设
  • 南通网站建设推广专家wordpress 信息流 主题
  • 网站培训机构有哪些大学生做企业网站
  • 网站培训班有哪些课程做的好的大学生旅行有哪些网站好
  • 昌江县住房和城乡建设局网站佛山建设网站制作
  • 做网站 图片 文件夹 放哪儿北京模板网站建设
  • 网站制作公司哪家正规注册工程公司名称大全
  • 佛山微信网站建设哪家好做电商讲师课程的网站
  • 泰州城乡建设网站深圳logo设计公司哪家好
  • 东阳网站建设yw81wordpress登录注册页面梅花
  • 网站备案 厦门福州企业网站开发
  • 全国中小企业网站域名注册服务机构
  • 微信网站怎么做下载附件wordpress 代码执行
  • 5050众筹网站开发福州餐饮网站建设
  • 北京国家建设部网站网站备案需要去哪里
  • 廊坊哪里能够做网站网站改版影响
  • 比较好的源码网站手机网站支付如何制作
  • 深圳做网站哪个公司好重庆工程造价信息2021
  • 做电商宠物带哪个网站最好最近一周的重大新闻
  • 做网站难度李沧网站建设电话
  • 六安建设网站网站图片最大尺寸是多少
  • 手机建网站步骤软件优速网站建设
  • 导购网站如何做免费推广用wordpress开发网站模板
  • 建立网站 英语wordpress字体加载
  • 株洲网站建设和制作wordpress 瑞课教育
  • 网站开发培训什么淘宝客网站备案