![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python tool
夏天的欢
技术不重要、关键是要骚
展开
-
Python弹出文件选择框,获取文件路径
1、安装库2、源码原创 2022-06-26 14:53:33 · 4060 阅读 · 2 评论 -
python在当前目录下创建指定文件夹
import ospath = os.getcwd()for i in range(0,40): file_path = path + '\\'+ str(i) os.mkdir(file_path)原创 2020-10-23 15:46:01 · 9566 阅读 · 0 评论 -
python 批量修改图片的名字
修改前:修改后:代码:import osimport cv2 as cvimage_path = 'C:/Users/huan4/Desktop/Python/TensorFlow/train_ourself_data/01_classification_network/data/train/'for file in os.listdir(image_path): na...原创 2020-04-07 17:53:09 · 4458 阅读 · 7 评论 -
python——使用opencv修改证件照的背景颜色
将蓝底照片变成白底照片效果图:代码:import cv2import numpy as npimg = cv2.imread(r"C:\Users\huan4\Desktop\kanghuan\kanghuan.jpg")hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)lower_blue=np.array([90,70,70])upp...原创 2019-12-24 19:48:42 · 2832 阅读 · 4 评论 -
Jupyter Notebook的安装和使用教程(Linux)
安装1、conda安装conda install jupyter notebook2、pip安装#先更新pippip install --upgrade pip#安装pip install jupyter运行Jupyter Notebook1、查看帮助文档jupyter notebook --help2、启动#默认端口启动jupyter notebook#指定端口...原创 2019-12-03 11:20:07 · 2397 阅读 · 0 评论 -
相机标定板的代码制作(python)
简易打印版import cv2import numpy as npwidth = 500height = 500length = 50image = np.zeros((width,height),dtype = np.uint8)print(image.shape[0],image.shape[1])for j in range(height): for i in ...原创 2019-09-23 10:41:11 · 1566 阅读 · 3 评论 -
TensorFlow object detection API以json格式输出测试集数据(python)
import timestart = time.time()import numpy as npimport osimport tensorflow as tfimport pandas as pdimport csvimport jsonfrom PIL import Imagefrom object_detection.utils import label_map_util...原创 2019-09-20 21:22:15 · 531 阅读 · 1 评论 -
TensorFlow object detection API以csv格式输出测试集数据(python)
import timestart = time.time()import numpy as npimport osimport tensorflow as tfimport pandas as pdimport csvfrom PIL import Imagefrom object_detection.utils import label_map_utilos.environ['...原创 2019-09-20 21:17:01 · 373 阅读 · 0 评论 -
提取目录下所有文件的名字到txt文档(python)
file_name.py这里提取的是所有xml格式的文件名from glob import globftrainval = open('C:/Users/huan4/Desktop/Python/VOC2007/ImageSets/trainval.txt', 'a') #保存文件的路径total_files = glob("C:/Users/huan4/Desktop/Pytho...原创 2019-09-19 17:37:58 · 1129 阅读 · 1 评论 -
csv转voc(python)
csv2voc.pyimport osimport numpy as npimport codecsimport pandas as pdimport jsonfrom glob import globimport cv2import shutilfrom sklearn.model_selection import train_test_splitfrom IPython i...原创 2019-09-18 16:09:07 · 1297 阅读 · 5 评论 -
json转voc(python)
json2voc.pyimport osimport numpy as npimport codecsimport jsonfrom glob import globimport cv2import shutilfrom sklearn.model_selection import train_test_splitfrom tqdm import tqdmimport pand...原创 2019-09-18 15:50:23 · 2912 阅读 · 11 评论 -
读取图片信息工具(python)
RGB_show.pyimport cv2img = cv2.imread("C:/Users/huan4/Desktop/Python/tool/JPEGImages/00a6cf1233b1cf170835381106_90d.jpg")gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)hsv = cv2.cvtColor(img, cv2.CO...原创 2019-09-18 15:46:39 · 695 阅读 · 0 评论 -
深度学习数据增强,同时修改xml文件(python)
augmentation.py用于翻转的数据增强import cv2import mathimport numpy as npimport osimport pdbimport xml.etree.ElementTree as ETclass ImgAugemention(): def __init__(self): self.angle = 90 ...原创 2019-09-18 15:42:18 · 4349 阅读 · 24 评论