常用代码
所思即所得
潜龙勿用 见龙在田 终日乾乾 或跃在渊 飞龙在天 亢龙有悔
展开
-
如何计算自己的图片数据集的均值和方差
import numpy as np import pickle def load_CIFAR_batch(filename): """ load single batch of cifar """ with open(filename, 'rb') as f: datadict = pickle.load(f,encoding='latin1') ...原创 2019-04-24 20:46:13 · 6933 阅读 · 1 评论 -
detection
import os from PIL import Image import sys sys.path.append('/home/xm/桌面/caohuifinger') from utils import parse_voc_xml,mkdir_if_not_exist class_names = ['finger'] os.environ['data_root'] = data_root ...原创 2018-09-06 23:21:03 · 157 阅读 · 0 评论 -
mouse select
#include "opencv2/core/core.hpp" #include "opencv2/objdetect/objdetect.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <tchar.h> #include <...原创 2018-09-06 18:22:19 · 155 阅读 · 0 评论 -
xml转化成txt
import os import sys import xml.etree.ElementTree as ET import glob def xml_to_txt(indir,outdir): os.chdir(indir) annotations = os.listdir('.') annotations = glob.glob(str(annotations)+'...转载 2018-09-06 17:30:43 · 3175 阅读 · 1 评论 -
使用python将某一类型的图片格式放入某一文件夹内
import os import shutil path = '/home/xm/桌面/finger' list = os.listdir(path) for i in range(0,len(list)): files = list[i] if files[-4:] == 'tiff': file_path = '/home/xm/桌面/finger/' + files print...原创 2018-09-04 11:57:44 · 620 阅读 · 0 评论 -
文件内图片全部重命名
参考:https://blog.csdn.net/zhyh1435589631/article/details/51788350 import os path = r'C:\Users\Administrator\Desktop\pos' filelist = os.listdir(path) total_num = len(filelist) i = 0 path_new = r'C:\Us...转载 2018-08-21 14:32:37 · 553 阅读 · 0 评论 -
如何通过鼠标采集图片数据集
合成图片原创 2019-04-24 20:54:21 · 636 阅读 · 0 评论