- 博客(11)
- 收藏
- 关注
原创 python实现比对两个文件夹下的所有文件,将不同文件复制到文件夹3,相同文件复制到文件夹4
import osimport shutil# 将in_path文件夹里的所有文件复制到out_path中def copy_file(in_path, out_path): if not os.path.isdir(in_path): shutil.copy(in_path, out_path) else: if not os.path.exists(out_path): os.makedirs(out_path)
2022-01-03 10:29:27
1261
原创 Python实现遍历文件夹下xml文件转化为yolo格式的txt文件
import xml.etree.ElementTree as ETimport pickleimport osfrom os import listdir, getcwdfrom os.path import joinclasses = ['person', 'forklift'] def convert(size, box): dw = 1. / (size[0]) dh = 1. / (size[1]) x = (box[0] + box[1]) / 2.0
2021-11-18 14:55:29
611
原创 Python实现遍历文件夹下所有文件并重命名排序
存在问题:1.多次重复运行会导致文件丢失2.文件原有顺序会被打乱import oscount = 1path = ""filelist = os.listdir(path)for file in filelist: print(file)for file in filelist: Olddir = os.path.join(path, file) if os.path.isdir(Olddir): continue filename = os
2021-11-18 14:52:08
1214
原创 Python实现比对两个文件夹下文件名,删除不同的文件
# -*- coding: utf-8 -*-import osroot_path = ''def contrastDir(file_dir): jpg_list = [] xml_list = [] for root, dirs, files in os.walk(file_dir+'11.11'): # 文件夹a路径 for file in files: if os.path.splitext(file)[1] ==
2021-11-18 10:21:15
2056
原创 2021-10-28 使用Python从txt中读取YOLO格式标签,OpenCV可视化在对应图片上;并统计各标签出现数量
import numpy as npimport cv2import torchsource_directory_img_path= ''source_directory_label_path= ''target_directory_path= ''dic={}#坐标转换,原始存储的是YOLOv5格式# Convert nx4 boxes from [x, y, w, h] normalized to [x1, y1, x2, y2] where xy1=top-left, xy2=bo
2021-10-28 09:10:02
2864
1
原创 工作日志1.1.1
1.在ubuntu上通过docker简便安装微信,并解决:1.电脑重启后无法跳出登录界面问题(手动运行xhost+)2.传输文件方式问题(位于挂载文件夹wechatfiles目录下)把安装步骤编写文档:https://blog.csdn.net/hxc0520/article/details/120871254?spm=1001.2014.3001.55022.用python编写脚本,将视频文件按固定帧数间隔截图,使截图仅保留需要的矩形部分并保存:# 将现场拍的视频抽针转为图片,保存到img
2021-10-24 15:34:25
92
原创 2021-10-20 在虚拟机Ubuntu系统上搭建Milvus以图搜图demo
项目链接:bootcamp/solutions/image_search2 at 1.0 · milvus-io/bootcamp · GitHub1.下载数据源:https://pan.baidu.com/s/1MjACqsGiLo3oiTMcxodtdA验证码: v78m有以下两个方法从宿主机移动到虚拟机:1.通过VMware tools直接拖拽,如果VMware tools安装后拖拽移动功能无法正常使用,尝试重启虚拟机和宿主机。由于文件较大,此方法会响应较长时间,且移动速度较慢。..
2021-10-20 19:45:20
1061
1
原创 2021-10-20 多线程编写opencv(python)获取摄像头画面,通过队列(queue)实现线程间数据共享
代码来自:https://blog.csdn.net/Raink_LH/article/details/111582308import timeimport cv2from queue import Queuefrom threading import Thread """Camera类只负责从摄像头获取图像对图像的处理(包括显示)由外部定义"""class Camera: def __init__(self, device_id, frame_queue):
2021-10-20 18:15:36
2019
原创 2021-10-20在Ubuntu上通过docker安装微信(非web客户端)
经过查阅资料,发现网上在Ubuntu上安装微信的办法基本上有两种。一种是在Ubuntu中安装deepin-wine,通过deepin-wine的软件库安装微信;另一种则是通过一个GitHub上的项目叫electronic-chat,但这种方法其实是基于web客户端的,不符合题目要求。而通过deepin-wine的安装方法较复杂,且软件库很久没有更新,使用中还会有bug。本文介绍了通过docker安装的办法,非常简单实用。1.在Ubuntu中部署docker参考以下两个链接:https://blo
2021-10-20 17:55:35
1174
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人