![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
一蓑烟雨渡平生
故事还没有结束。
展开
-
批处理文件夹内的图像 只复制文件夹中名称含有“t”的图片
只复制文件夹中名称中含有“t”的图片。import shutilimport os原创 2023-03-13 09:14:32 · 121 阅读 · 1 评论 -
SRNet泛化性测试,判断txt文本中行中内容相同的个数
SRNet泛化性测试,判断txt文本行中内容相同的个数。原创 2023-02-28 11:31:28 · 143 阅读 · 0 评论 -
使用百度飞浆识别器识别图像中的文本
【代码】使用百度飞浆识别器识别图像中的文本。快速有效!!原创 2023-02-28 11:27:40 · 276 阅读 · 0 评论 -
SpaptialEmbeddings-master 代码解读
整体代码等全部注释后上传,目前对部分不易注释的代码记录self.wins[key] = plt.subplots(ncols=n_images)令n_images=1、2、3。以3为例from matplotlib import pyplot as pltwins[keys] = plt.subplots(ncols=3)print(wins[keys])plt.show()输出:(<Figure size 640x480 with 3 Axes>, array([AxesSu原创 2021-08-13 15:29:29 · 147 阅读 · 0 评论 -
批处理重命名图像文件名 python
'''批处理,将图像重命名为固定格式名称比如把 0000.png换成000_i_s.png 0001.png换成001_i_s.png'''import os# 设置图像所在文件夹路径source_path = r'C:\Users\Administrator\Desktop\labels_i_t'# 获取图像所有的名称,以 list 形式返回filelist = os.listdir(source_path)# 获取当前文件夹里共有多少张图像,len从0开始计时.原创 2022-05-18 16:37:07 · 359 阅读 · 0 评论 -
将数据集中的txt文件中的坐标转换为mask图像
# -*- coding: utf-8 -*-# @Time:2021/10/13# @Author:pheimport osimport cv2import numpy as np#读取path中对应的txt文件,并将txt文件中的坐标转换为mask图像,存入savepath路径中。def txtToImg(path,savepath): files = [] for file in os.listdir(path): if file.endswith("原创 2021-10-13 11:06:51 · 1572 阅读 · 0 评论 -
读取文件夹里面的绝对路径并写入txt文件 python
#读取文件夹里面的绝对路径import osdir_path = 'D:\Synthetic_Data\Syn2.0\OriImgs\oriImgs1-9'imageName_list = os.listdir(dir_path)filepath = os.getcwd()allfile = []for file in imageName_list: allfile.append(dir_path + '\\' + file)list = str(allfile)print(al原创 2021-09-28 16:43:47 · 836 阅读 · 0 评论 -
两张图片相减得到交集部分 python
import cv2 as cvimport numpy as npdef get_mask(ori_image, syn_image, thr=32): syn_h, syn_w, _ = syn_image.shape # (338, 600, 3) # cv.imshow('ori', ori_image) # cv.imshow('syn', syn_image) #print(ori_image.shape) #(360, 640, 3)原创 2021-09-26 15:36:33 · 1656 阅读 · 2 评论