![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
只只只只只
这个作者很懒,什么都没留下…
展开
-
xml文件转换成json文件
import xml.etree.ElementTree as ETimport osimport jsoncoco = dict()coco['images'] = []coco['type'] = 'instances'coco['annotations'] = []coco['categories'] = []category_set = dict()image_set = set()category_item_id = -1image_id = 20180000000a原创 2022-01-23 23:06:06 · 3118 阅读 · 4 评论 -
python查看pkl文件
# show_pkl.pyimport picklepath = 'E:/somecode/Faster-RCNN-TensorFlow\default/voc_2007_trainval/default/vgg16_faster_rcnn_iter_10000.pkl'# path='/root/……/aus_openface.pkl' pkl文件所在路径f = open(path, 'rb')data = pickle.load(f)print(data)print(len(原创 2022-01-23 17:54:36 · 2765 阅读 · 0 评论 -
python字符串替换
将D改成d# coding:utf8import os;# 将xml文件中的类别D改为ddef reset(): i = 0 path = r"H:/roaddamagecode/fourclass_xml/"; filelist = os.listdir(path) # 该文件夹下所有的文件(包括文件夹) for files in filelist: # 遍历所有文件 i = i + 1 Olddir =原创 2022-01-23 17:51:07 · 158 阅读 · 0 评论