2022年8月2日

VOC转YOLO(自己的数据集)

摘要: VOC转YOLO(自己的数据集) import os import shutil import cv2 from lxml import etree def VOC2Yolo(class_num, voc_img_path, voc_xml_path, yolo_txt_save_path, yol 阅读全文
posted @ 2022-08-02 16:26 DLst_liu 阅读(645) 评论(0) 推荐(0) 编辑

yolo转voc格式(自己的数据集)

摘要: yolo转voc格式(自己的数据集) 一、yolo格式的数据集 二、voc格式的数据集 三、代码 import cv2 import os xml_head = '''<annotation> <folder>VOC2007</folder> <filename>{}</filename> <sou 阅读全文
posted @ 2022-08-02 16:23 DLst_liu 阅读(452) 评论(0) 推荐(0) 编辑
2022年7月30日

python 将图片转换成RGB

摘要: python 将图片转换成RGB import os from PIL import Image # 填入图片所在文件夹的路径 img_path = 'E:\chengxu\CV\dataset_hat_person\hat' # 获取该路径下的图片 img_all = os.listdir(img 阅读全文
posted @ 2022-07-30 10:37 DLst_liu 阅读(723) 评论(0) 推荐(0) 编辑
2022年7月27日

利用python 在txt中添加指定内容

摘要: 利用python 在txt中添加指定内容 一、原txt的内容 二、添加内容后的txt 三、代码 import os # 文件夹的路径 scr = 'E:\DATASET\Main' # 获取文件夹下的txt的文件名 fs = os.listdir(scr) print(fs) for fz in f 阅读全文
posted @ 2022-07-27 16:48 DLst_liu 阅读(1269) 评论(0) 推荐(0) 编辑
2022年7月22日

torch.arange()和torch.arange().reshape()和torch.transpose()可视化理解

摘要: torch.arange()和reshape()和torch.transpose()可视化理解 一、torch.arange()和torch.transpose() ·重点解释Tensor的可视化 ·torch.arange():产生一维Tensor ·torch.arange().reshape( 阅读全文
posted @ 2022-07-22 17:28 DLst_liu 阅读(3653) 评论(0) 推荐(1) 编辑
2022年7月20日

利用Python寻找两个文件夹下不相同的文件

摘要: 找不同.txt 由于在打标签的时候,有些图像可能不存在标签,因此导出.txt文件可能缺少该标签的文件,而images下又存在该图片。可通过python寻找未打标签的文件。 images = 1116 labels = 1113 打标签的时候,有三张图片没有标签,因此images多出三个文件,可通过p 阅读全文
posted @ 2022-07-20 10:45 DLst_liu 阅读(328) 评论(0) 推荐(0) 编辑