- 博客(46)
- 收藏
- 关注
原创 mmdetection中使用训练好的模型批量检测图片并保存到文件夹
保存到文件夹查看预测情况from argparse import ArgumentParserimport osfrom mmdet.apis import inference_detector, init_detector #, show_result_pyplotimport cv2def show_result_pyplot(model, img, result, score_thr=0.3, fig_size=(15, 10)): """Visualize the dete
2021-03-22 09:10:35
6146
22
原创 选出含有所需类别目标的图片把文件名写入txt,并且遮盖图片中其他类别并修改对应标注
首先在数据集中选择你所需要的类别,这里用base代表所需类别import osimport shutilimport randomimport xml.dom.minidomxml_path = 'F:/data/Annotations/'main_path = 'F:/data/main/'total_xml = os.listdir(xml_path)gt_dict = {}novel = ['1', '6', '11']base = ['2', '3', '4', '5'
2021-03-06 14:57:56
340
原创 leetcode题目-LRU缓存机制
题目:运用你所掌握的数据结构,设计和实现一个LRU (最近最少使用) 缓存机制 。实现 LRUCache 类:LRUCache(int capacity) 以正整数作为容量capacity 初始化 LRU 缓存int get(int key) 如果关键字 key 存在于缓存中,则返回关键字的值,否则返回 -1 。void put(int key, int value)如果关键字已经存在,则变更其数据值;如果关键字不存在,则插入该组「关键字-值」。当缓存容量达到上限时,它应该在写入新数据...
2021-03-04 19:57:19
246
1
原创 统计VOC格式标签XML中的种类和各类别数目(从高到低)
import osimport xml.dom.minidomxml_path = 'F:/data/Annotations/'files = os.listdir(xml_path)gt_dict = {}if __name__ == '__main__': for xm in files: xmlfile = xml_path + xm dom = xml.dom.minidom.parse(xmlfile) # 读取xml文档 .
2021-03-04 19:54:25
916
1
原创 leetcode 链表题目
1、翻转链表链接:https://leetcode-cn.com/problems/reverse-linked-list//** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */class Solution { public ListNode
2020-12-22 17:35:50
100
原创 mmdetection问题,待解决2020-11-11
mmdetection中train.py里最重要的一部分,但是不太明白,比如我输入了config,用了faster rcnn模型,它是在哪一部被搭建起来调用了mmdet/models/detectors/faster_rcnn.py的呢,是在build_detecor阶段的build_from_cfg还是在train_detector呢???(应该不是train_detector)还是不太了解registry部分和build_from_cfg以及@修饰,先留下这个疑惑日后解决吧……model = .
2020-11-11 19:12:05
242
转载 错误 Error opening zip file or JAR manifest missing :
错误原因:使用jar破解了idea(pycharm后),被我卸载了 后续进行重装,但利用pycharm.sh启动的时候一直报找不到原先放置的破解jar文件 具体错误如下: django@ubuntu:/opt/pycharm-2020.2.1/bin$ ./pycharm.sh OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely .
2020-11-02 16:25:50
1463
转载 ubuntu关机开机后显卡挂了:报错NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver. Make
傻电脑每次关机后开机显卡几乎都要挂,nvidia-smi显示NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.https://www.jianshu.com/p/3cedce05a481
2020-11-01 15:37:47
268
1
原创 ubuntu18.04下使用conda配置mmdetection
终于配置好,凭记忆记录一下过程,防止以后重装系统忘记……这里默认之前已经配置好nvidia驱动和anaconda环境1、打开terminal,创建环境conda create -n mmdetection python=3.7conda activate mmdetection
2020-10-15 10:52:58
568
2
原创 windows10下yolov4训练自己的数据
配置过程:https://blog.youkuaiyun.com/weixin_43723614/article/details/105772081【配置过程一定要注意:如果电脑以前装好了CUDA,再重新安装VS的话,训练时会提示 GPU isn't used!!!经查阅好像是因为VS需要在CUDA之前安装,也就是说顺序非常重要,这时候只要把CUDA卸载重装就可以了。像我的机器是有两个版本的CUDA,只卸载一个再重装是不行的,两个都卸掉再重装需要的那一个就OK了。】参考训练配置过程:https://blog.c
2020-05-15 23:20:13
3518
原创 tensorflow修改每次训练保存模型数量和间隔时间
最近使用tensorflow object detection api,发现训练只保存最新的五次模型,而且是每隔十分钟保存一次,于是就想怎么才能改掉这个默认值,找了好久最后终于找到了,记录一下。关于多长时间保存一次,可以通过model_main.py里的最后这行tf.estimator.RunConfig来修改。def main(unused_argv): flags.mark_flag_as_required('model_dir') flags.mark_flag_as_require
2020-05-12 17:31:13
3294
原创 Faster R-CNN 读源码(tensorflow版)
随手记录一下,还有很多看不明白的地方,并且把源码中的vgg改成了resnet。如果有错误还请指正。GitHub地址:https://github.com/dBeker/Faster-RCNN-TensorFlow-Python3直接从训练开始看起,train.pyif __name__ == '__main__': train = Train() train.train()然后跳转到class Train: def __init__(self): .
2020-05-10 23:40:24
369
原创 滑动窗口式的裁剪图片与标注框(数据扩充)
#coding:utf-8import cv2import osimport codecsimport xml_parseimport xml.dom.minidom as xmldomimport xml.etree.ElementTree as ETimport numpy as npfrom tqdm import tqdmimport syssys.setrecurs...
2020-04-07 23:52:06
2778
23
原创 win10下用tensorflow object detection API训练自己的数据出错
(gtf36) D:\models-master\models\research\object_detection>python model_main.py --pipeline_config_path=mytraining/faster_rcnn_resnet101_coco.config --model_dir=object_detection/mytraining --num_tra...
2020-03-19 00:08:36
7196
原创 tensorflow+opencv-图片缩放
#1 load 2 info 3 resize 4 checkimport cv2img = cv2.imread('bucky.jpg',1)imgInfo = img.shapeprint(imgInfo)height = imgInfo[0]width = imgInfo[1]mode = imgInfo[2]#1 放大 缩小 2等比例 非dstHeight = in...
2019-06-14 19:10:29
338
原创 tensorflow_神经网络逼近股票收盘均价
首先这个矩阵运算就很神奇,总是忘记,写在前头,像下面这个3×2的矩阵是可以直接加一个1×2的矩阵,分别加到每一行上import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltdate = np.linspace(1,15,15)endPrice = np.array([2511.90,2538.2...
2019-06-14 00:55:38
244
转载 TensorFlow学习笔记——节点(constant、placeholder、Variable)
作者:Vulper地址:http://www.cnblogs.com/Vulpers/p/7809276.html本文版权归作者和博客园共同所有,欢迎转载,转载必须注明出处。一、 constant(常量) constant是TensorFlow的常量节点,通过constant方法创建,其是计算图(Computational Graph)中的起始节点,是传入数据。创建方式...
2019-06-12 22:55:08
293
原创 win10+anaconda3+TensorFlow+opencv安装配置
搞了好几天终于弄好了,记录一下踩坑经历。因为国外网站下载慢,一开始不知道,总是失败,教程上的镜像都关掉了,没办法翻墙只能硬着头皮下,后来总算找到靠谱教程。首先是这个win10+anaconda3https://www.jianshu.com/p/52c6c9afe33e只是把其中的镜像源改成了https://blog.youkuaiyun.com/xdwly96/article/detail...
2019-06-08 23:43:40
380
原创 深入理解OpenCV第一章
Android系统上生成卡通画不知道为什么外星人那块的函数运行到floodfill的时候一直不出结果……其他部分都很正常orz/* main.cpp */#include <opencv2/opencv.hpp>#include <iostream>#include <math.h>#include "cartoon.h"using ...
2019-05-30 23:09:59
251
原创 图像矩阵是如何存储在内存中的
http://www.opencv.org.cn/opencvdoc/2.3.2/html/doc/tutorials/core/how_to_scan_images/how_to_scan_images.html#how-image-stored-memory
2019-05-18 18:29:19
1981
原创 canny边缘检测 MATLAB
https://www.cnblogs.com/tiandsp/archive/2012/12/13/2817240.html
2019-05-17 16:58:26
499
转载 高频分量和低频分量
图像中的低频信号和高频信号也叫做低频分量和高频分量。简单一点说,图像中的高频分量,指的是图像强度(亮度/灰度)变化剧烈的地方,也就是我们常说的边缘(轮廓);图像中的低频分量,指的是图像强度(亮度/灰度)变换平缓的地方,也就是大片色块的地方。人眼对图像中的高频信号更为敏感。...
2019-05-10 19:00:19
7972
转载 Matlab 的fspecial函数用法
https://www.cnblogs.com/wuxinrui/archive/2011/04/14/2015979.htmlfspecial函数用于建立预定义的滤波算子,其语法格式为:h = fspecial(type)h = fspecial(type,para)其中type指定算子的类型,para指定相应的参数;type的类型有:1、'average'averagi...
2019-05-03 21:41:41
900
原创 MATLAB函数
快忘光了MATLAB,把不会的函数存一下★matlab中的下标都是从1开始的★原文:https://blog.youkuaiyun.com/caomin1hao/article/details/78510298Matlab函数定义格式,用关键字function定义函数function [输出变量] = 函数名称(输入变量)% 注释% 函数体简单的函数如下:...
2019-05-01 18:59:33
311
原创 MATLAB基本图像处理——简单的操作
只记录一部分,存存图clear,close allI=imread('rice.png');imshow(I);background=imopen(I,strel('disk',15));%imshow(background)%figure,surf(double(background(1:8:end,1:8:end))),zlim([0 256]);%set(gca,'Ydir...
2019-04-29 22:12:03
1794
原创 区号|电话号码|城区|邮编
参考了https://blog.youkuaiyun.com/qq_32925781/article/details/79377073 本来想用strtok 不是很好用#include <iostream>#include <string> #include <cstring>#include <fstream>using namespace s...
2019-03-12 18:49:36
532
原创 求最小公倍数
#include <iostream>using namespace std;int main(){ int a,b; int i; cin>>a>>b; if(a<b){ int t; t=b; b=a; a=t; } while(a*i%b!=0){ i++; } cout<<a*i<&...
2019-03-12 15:35:27
164
原创 string::npos为啥不是-1
#include <iostream>#include<cmath>#include<string>using namespace std;int main(){ string s("noon is 12 pm; midnight is not."); cout<<s.find("is")<<endl; c
2019-03-11 12:17:45
496
原创 处理字符串(025)87234865-987
小结:根据http://www.cplusplus.com/reference/cstring/strtok/发现strtok的第二个参数可以填不止一个符号 解决了 之前删除“(”导致下面没有结果了的问题,但还是不太清楚到底是哪里出错,是因为NULL才没有的吗#include <iostream>#include<cstring>#include<stri...
2019-03-04 17:24:17
203
原创 简单加密算法
main()中接收需要加密的字符串,加密时,字符指针+1,Encrpy参数为字符指针, 解密时-1,Decrpy参数也是字符指针#include <iostream>#include<cstring>#include<cmath>using namespace std;void Encrpy(char *p){ int n=strlen(p);...
2019-03-04 16:28:56
1294
原创 编写一个teacher类
要求含有教师编号,姓名,性别, 出生年月, 入职年月,以及以下成员函数: ①带有默认参数的构造函数(默认出生年月为1900-00-00),复制构造函数 ②2016年进行新一轮聘用,男性满55,女性满60则到退休年龄,输出应退休的编号和姓名③如果满退休 年龄女老师入职未满35年,则继续聘用,输出姓名和编号④编写main函数测试随便写了写#include <iostr...
2019-03-03 21:47:07
3406
原创 编写FindRepStr()函数,功能为在字符串str中查找目的字符串findStr,并用replaceStr替换,最后输出替换后的字符串str
题目:编写FindRepStr()函数,功能为在字符串str中查找目的字符串findStr,并用replaceStr替换,最后输出替换后的字符串str。函数原型为voidFindRepStr(char str[],const char findStr[],const replaceStr[])小结:直接把形参的char[]转成 string,调用string的 函数更简单#includ...
2019-03-03 19:05:22
1471
2
原创 编写一个递归函数,其功能是:输入一个字符串,字符间都有空格,输出一个整型值。如:“1 x 2 y z 3 d h 4 g 5 “,输出为54321。
#include <iostream>#include<string>using namespace std;static int count=0,i=0;void print(char a[],char b[],int len){ if(a[i]>='0'&&a[i]<='9'){ b[count]=a[i]; count+...
2019-03-03 17:20:03
868
原创 使用字符数组存储一段字符,判断是否是回文字符串(需要判断并忽略空格)
#include <iostream>#include<string>using namespace std;int main(){ char a[]="123 43 21",b[20]={0}; int len=sizeof(a)-1;//sizeof算上最后的'\0'了 cout<<"数组长度为:"<<len<&l
2019-03-03 16:19:58
1442
转载 摘抄例题-定义一个哺乳动物Mammal类,再由此派生出狗Dog类,定义一个Dog类的对象,观察基类与派生类的构造函数与析构函数的调用顺序。
#include <iostream>using namespace std;enum myColor{BLACK, WHITE };class Mammal{public: // constructors Mammal(); ~Mammal(); //accessors int GetAge() const { return itsAge; } void S...
2019-03-03 11:43:45
19358
原创 字符串奇偶排序
借鉴了循环判定条件#include<iostream>#include<fstream>using namespace std;int main(){ ifstream file1("text.txt"); char a[20],ch; int i=0; while(file1.get(ch)){//文件中读取的数据存入数组 cout&l...
2019-03-02 23:59:19
459
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人