- 博客(53)
- 收藏
- 关注
原创 mmdetection 报错 TypeError: FormatCode() got an unexpected keyword argument ‘verify‘
参考:MMdetection遇到问题:FormatCode() got an unexpected keyword argument ‘verify‘-CSDN博客。在mmdetection上训练faster rcnn报错。原因: yapf版本过高,目前版本为 0.40.2。解决方法:重装低版本yapf即可。
2024-01-07 23:21:16 777
原创 importlib.import_module(“cv2“)libGL.so.1: cannot open shared object file: No such file or directoryl
【解决方法】libGL.so.1: cannot open shared object file: No such file or directory。这些命令安装通常存在于本地计算机上的 cv2 依赖项,但可能会在您的 Docker 容器中丢失,从而导致问题。2、libGL.so.1由 package 提供libgl1,所以添加一下代码。对于我来说,安装opencv-python-headless是有效的。在Stack Overflow上有其他回答,当我试了无效。这些都是高赞回答,对于大家应该有效。
2024-01-07 23:06:17 425
原创 将图片对半切开并将切开的前半部分图片左右拼接
导入相应的包def read_path(file_pathname):#遍历该目录下的所有图片文件image_list = []for filename in os.listdir(file_pathname):#print(filename)img = cv2.imread(file_pathname+‘/’+filename)#print(img.shape)im = img[0:2100, 0:1200]#cv2.namedWindow(‘result’, cv2.WINDOW_NO
2022-05-24 10:37:12 254
原创 生成同名JPG的txt文件
import os,redef img_generate_txt(path):filelist = os.listdir(path)for file in filelist: if file.endswith('.jpg'): itemname = os.path.join(path, file) a = re.sub(re.escape(".jpg") + '$', '', itemname) #print(a) #print(path)
2022-04-12 18:54:59 499
原创 xml美化工具
@https://tool.lu/xml/欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。新的改变我们对Markdown编辑器进行了一些功能拓展与语法支持,除了标准的Markdown编辑器功能,我们增加了如下几点新功能,帮助你用它写博客:全新的界面设计 ,将会带来全新的写作体验;在创作中心设置你喜爱的代码高亮样式,Markdown 将代码片
2022-04-12 17:20:34 2377
原创 【Python】检测下载不完整、半截灰色的JPG、JPEG、PNG图片脚本
出现这种问题的原因是什么呢?1、网络问题:网络不稳定,接收到的图片信息不完整。也就是说response有问题;2、本地磁盘满了:有时候接收到的图片信息完整,但是本地磁盘存不下了,毕竟一个图片也要好几Mb呢。如何检测错误图片呢?试了很多方法,一个较好的方法就是判断jpg、jpeg、png文件结尾的标识。JPG文件结尾标识:\xff\xd9JPEG文件结尾标识:\xff\xd9PNG...
2020-03-25 13:53:45 893
原创 巧妙处理 return 遇上 for 循环
函数中怎么在 for 循环后 返回列表的全部元素?什么?有点晕,那就举例看看我们先看一个简单的 for 循环的栗子:for i in range(1,6):print(i)–>输出结果:12345我们的需求是:返回 i 的全部元素我们现在把这个循环放在函数中,我们直接调用函数看看。def brucepk():for i in range(1,6):return ...
2020-03-24 14:54:55 737
原创 cfg.120
[net]#Testing#batch=64#subdivisions=64Trainingbatch=64subdivisions=32width=960height=960channels=3momentum=0.9decay=0.0005angle=0saturation = 1.5exposure = 1.5hue=.1learning_rate=0.000...
2020-01-20 10:24:24 140
原创 darknet.py
from ctypes import *import mathimport randomimport cv2import osimport shutilimport timedef sample(probs):s = sum(probs)probs = [a/s for a in probs]r = random.uniform(0, 1)for i in range(len...
2020-01-07 11:50:18 397
原创 修改yolo标注txt中不是0的
import os, shutildef change_files():path =r"D:\Users\h2410796\Desktop\0-chognbiao"# 用os.walk方法取得path路径下的文件夹路径,子文件夹名,所有文件名for foldName, subfolders, filenames in os.walk(path): # print(filenames...
2020-01-06 09:29:16 237
原创 yolov3 调参
[net] ★ [xxx]开始的行表示网络的一层,其后的内容为该层的参数配置,[net]为特殊的层,配置整个网络Testing ★ #号开头的行为注释行,在解析cfg的文件时会忽略该行batch=1subdivisions=1Trainingbatch=64 ★ 这...
2020-01-06 09:16:52 3232 1
原创 yolo标注txt文件中第一个字符改成0
import os, shutildef change_files():path =r"D:\Desktop\0-chognbiao"# 用os.walk方法取得path路径下的文件夹路径,子文件夹名,所有文件名for foldName, subfolders, filenames in os.walk(path): # print(filenames) # 遍历列表下的所...
2019-12-28 11:01:22 469
原创 darknet1
from ctypes import *import mathimport randomimport cv2import osimport shutilimport timedef sample(probs):s = sum(probs)probs = [a/s for a in probs]r = random.uniform(0, 1)for i in range(len...
2019-12-28 10:59:44 167
原创 根据网址下载图片,并与txt中编号相匹配的图片留下来
import reencoding: utf-8import requests,json,refrom urllib.request import urlretrievelist=[]#字典r=requests.get(“http://10.:5555/invoke/Svc.websvc/get_SNInfo?startdt=2019-12-20”).json()l=r[‘resul...
2019-12-23 16:00:11 113
原创 切图后过darkent.py
from ctypes import *import mathimport randomimport cv2import osimport numpy as npimport shutildef clip(image,overlap,nh,nw):h,w,c=image.shapey_step=nh-overlapx_step=nw-overlaprois=[]for ro...
2019-12-20 16:23:12 100
原创 OpenCV中如何提取不规则ROI区域
ROI是英文Region Of Interest的三个首字母缩写,很多时候我们对图像的分析就是对图像特定ROI的分析与理解,对细胞与医疗图像来说,ROI提取正确才可以进行后续的分析、测量、计算密度等,而且这些ROI区域往往不是矩形区域,一般都是不规则的多边形区域,很多OpenCV初学者都不知道如何提取这些不规则的ROI区域。其实OpenCV中有个非常方便的API函数可以快速提取各种非正常的ROI区...
2019-12-17 05:16:24 1819
原创 8个同名文件夹中删除不同文件
import os, shutildef remove_files():“”"Delete files in path 1 that are different from path 2:return:“”"#path1path1 = r'E:\test\dd2\dd/'#path2path2 = r'E:\test\dd2\ddss/'# path1下的文件夹列表# List...
2019-12-15 22:04:49 250
原创 对切后图片根据切割原点及原图标注位置重新自动标注
* coding:utf-8 *import xml.etree.ElementTree as ETfrom xml.etree import ElementTreeimport pickleimport osfrom os import listdir, getcwdfrom os.path import joinimport cv2import numpy as npfrom...
2019-12-14 14:23:22 363
原创 将图片切成n份,以图片名命名的文件夹里放n份图片,并以切后图片名命名放同名新文件夹里,重新命名
import osimport shutilimport cv2path = r’D:/cut_43/cut_D43_CODE/data/3/’filelist = os.listdir(path)for file in filelist :# print(file)adr = path + fileprint(adr)filelist1=os.listdir(adr)# pr...
2019-12-14 14:20:31 112
原创 批量给txt文件名同时加1
import os,shutildef copy_files():path=‘D:\E\txt1’new_path=‘D:\E\txt’for dir,root,files in os.walk(path):for file in files:file=file.split(’.’)[0]pic_file=file+‘1’+’.txt’file=file+’.txt’shutil...
2019-12-14 14:13:12 398
原创 darknet.py
from ctypes import *import mathimport randomimport cv2import osimport shutilimport timedef sample(probs):s = sum(probs)probs = [a/s for a in probs]r = random.uniform(0, 1)for i in range(len...
2019-12-11 14:41:19 333
原创 切图2
import cv2import numpy as npimport osimport shutildef clip(image,overlap,nh,nw):h,w,c=image.shapey_step=nh-overlapx_step=nw-overlaprois=[]a=[]for row in range(0,h,y_step): for col in ra...
2019-12-11 09:48:25 77
原创 yolov3.cfg
[net]Testingbatch=64subdivisions=64#Training#batch=64#subdivisions=8width=608height=608channels=3momentum=0.9decay=0.0005angle=0saturation = 1.5exposure = 1.5hue=.1learning_rate=0.0003...
2019-12-11 09:23:39 119
原创 根据txt标注文件生成xml文件
from xml.dom.minidom import Documentimport osimport os.pathfrom PIL import Imageann_path=‘D:\E\txt\’#txt 文件夹img_path=‘D:\E\img\’#图片文件夹xml_path=‘D:\E\Annotations\’#xml 文件存放地址def CreateXml():imp...
2019-12-10 17:42:41 612
原创 根据xml在img上面画框
import osimport xml.dom.minidomimport cv2 as cvImgPath = ‘D:/E/img/’AnnoPath = ‘D:/E/Annotations/’ # xml文件地址save_path = ‘D:/E/temp/’def draw_anchor(ImgPath, AnnoPath, save_path):imagelist = os...
2019-12-10 17:41:49 585
原创 Yolov3 darknet检测时出现STB Reason: can't load ''
检测train.txt中是否出现1:,train.txt,2:还有1.txt中每一个物体一行:0,。。。。0,。。。。3:train.txt的最后一行清空
2019-12-10 11:07:08 1083 1
原创 Yolov3 darknet.exe检测时出现STB Reason: can't fopen
解决方法: 应该使用Notepad++ (1)视图》显示符号》显示所有符号; (2)编辑》档案格式转换》转换为UNIX格式; 确保最后一行有且仅有一个LF; 例如: D:/IMG1.jpg LF...
2019-12-10 11:03:25 1159
原创 delete各种文件
import osimport shutildef file1(dirpath):for root,dirs,file1 in os.walk(dirpath): return file1def file2(dirpath):for root,dirs,file1 in os.walk(dirpath):return file2file1=file1(’’)file2=f...
2019-12-03 10:31:14 243
原创 在包含JPG,txt文件夹里删除另一个只有JPG的文件夹里不同名的txt,jpg
import osmax=os.listdir(r’D:\Users\h2410796\Desktop\suoyou’)min=os.listdir(r’D:\Users\h2410796\Desktop\chengxubiaozhu’)for i in min:max.remove(i[:4]+'.txt')max.remove(i[:4]+'.jpg')for i in max:...
2019-12-02 15:44:12 229
原创 根据xml在图片上标框
import osimport xml.dom.minidomimport cv2 as cvImgPath = ‘D:/E/img/’AnnoPath = ‘D:/E/Annotations/’ # xml文件地址save_path = ‘D:/E/temp/’def draw_anchor(ImgPath, AnnoPath, save_path):imagelist = os...
2019-12-02 13:34:05 403
原创 yolo的txt转xml
from xml.dom.minidom import Documentimport osimport os.pathfrom PIL import Imageann_path=‘D:\E\txt\’#txt 文件夹img_path=‘D:\E\img\’#图片文件夹xml_path=‘D:\E\Annotations\’#xml 文件存放地址def CreateXml():imp...
2019-12-02 08:38:59 1787
原创 每隔几行删除resize,数字,在做loss曲线前。txt文件处理
with open(‘1.txt’) as reader,open(‘file.txt’,‘w’) as writer:try:text=reader.readlines()flg=Falsefor x in text:if x.rstrip().find(‘Resizing’)>-1 or flg:flg=not flgcontinueelse:print(x)writ...
2019-11-21 20:23:52 81
原创 网址批量下载图片
encoding: utf-8import osa=[]d http://10.xx.xx.xx/xx_1571030590.jpg (txt内容)f=open(‘D:/Do/Script .txt’)line=f.readline()while 1:lines = f.readlines(10000000)if not lines:breakfor line in li...
2019-11-21 14:40:06 193
原创 yolo 训练测试可视化图像
目录step1 制作数据集step2 训练模型step3 测试step4 可视化训练日志Darknet深度学习框架是由Joseph Redmon提出的一个用C和CUDA编写的开源神经网络框架,具体的环境搭建可以参考之前写的一篇文章:https://blog.csdn.net/stjuliet/article/details/87731998基本环境搭建成功后,就可以使用自己制作的数据集...
2019-11-19 08:40:49 1536
原创 python连接oracle数据库报错"DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: "解决方案
操作系统,python3.5, oracle_11, 均为64位;plsql 正常连接。也顺利安装了cx_oracle 6.3,但是python进行连接的时候就会报错"DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: " 。原因: instantclient版本为32位,需更换成64位。解...
2019-11-11 16:21:59 561
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人