摘要: 1. ffmpeg 可以完成视频抽帧。使用 ffmpeg 转换视频格式命令: 1 ffmpeg -i 原视频路径 输出视频路径 1. 调用本地摄像头 1 ### 读取摄像头中图像 2 import cv2 3 4 videoCapture = cv2.VideoCapture(0) 5 sucess 阅读全文
posted @ 2022-01-06 11:08 Bro_Li 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 查看当前文件夹下,各文件大小(最终显示:文件大小+文件名称): du -sh * 查看当前文件夹下,各文件大小(最终显示比较详细): ls -lht 删除指定文件: rm -f 文件的绝对路径 删除文件夹下所有文件(递归删除): rm -rf 文件夹的绝对路径 移动文件夹(文件)到指定目录下: mv 阅读全文
posted @ 2020-08-26 10:43 Bro_Li 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 在使用cv2调用摄像头时,我们常用循环语句完成capture的read和imshow,这使得当点击opencv窗口右上角关闭按钮时,关闭的仅仅是某个时刻的窗口,下一秒又会因为循环语句imshow出来。提供了cv2.getWindowProperty获取窗口属性,实现关闭窗口时退出程序。 1 # -* 阅读全文
posted @ 2023-02-07 09:21 Bro_Li 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 1. 菜单展示 system("pause"); 输入任意键继续 system("cls"); 清屏操作 2. 人、通讯录结构体创建 通讯录结构体中,m_Size; // 存储当前通讯录结构体中,记录的人员数量。对应前多少个位置存储着信息 (abs->personArray[i].m_Sex == 阅读全文
posted @ 2023-02-02 11:25 Bro_Li 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 本文介绍各种查看版本的命令: 1. 在pytorch中验证pytorch与cuda是否成功 import torch print(torch.cuda.is_available()) print(torch.backends.cudnn.is_available()) print(torch.cud 阅读全文
posted @ 2022-04-07 10:14 Bro_Li 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 综述 python 实现对于字符串的模糊匹配 python 实现对于字符串的模糊匹配 1 # python 实现对于字符串的模糊匹配 2 import difflib 3 4 # 第一个参数:所要进行搜索的关键字;第二个参数:所要进行匹配的目标列表 5 result = difflib.get_cl 阅读全文
posted @ 2022-01-27 17:15 Bro_Li 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 综述 对列表进行排序 对列表进行排序 1 temp = ['1', '3', '4', '5', '2', '6'] 2 temp = [1,5,6,4,8,2,3] 3 print(temp) 4 temp.sort() # 对列表数据进行排序 5 print(temp) 结果如下 1 [1, 5 阅读全文
posted @ 2022-01-27 17:04 Bro_Li 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 综述 输出系统的当前时间 输出系统的当前时间 1 # 输出系统的当前时间 2 from datetime import datetime 3 print('本次运行是几点 : ', datetime.now()) 4 print("hello world") 阅读全文
posted @ 2022-01-27 16:40 Bro_Li 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 使用 zipfile 的方式: import os import zipfile # 解压数据集函数 def unzip_data(src_path, target_path): # 解压原始数据集,将src_path路径下的zip包解压至data/dataset目录下 if(not os.path 阅读全文
posted @ 2022-01-27 11:44 Bro_Li 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 传入:存储 xml 的根路径 返回:一个 xml 文件中的标注存储为一条字典记录,返回出入根路径中所有 xml 标记的数据信息 1 import os 2 import xml.dom.minidom 3 4 ### 传入存储 xml 文件的根路径 --> 以字典的形式返回 xml 文件中存储的数据 阅读全文
posted @ 2021-12-13 11:04 Bro_Li 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 作用:传入存储xml文件的根路径,显示 xml 文件中所有的数据信息 1 import os 2 import xml.dom.minidom 3 4 def xml_label_names(xml_root_path): 5 xml_files = os.listdir(xml_root_path 阅读全文
posted @ 2021-12-13 10:32 Bro_Li 阅读(331) 评论(0) 推荐(0) 编辑