- 博客(30)
- 资源 (6)
- 收藏
- 关注
原创 opencv实时在图片上画矩形框并输出坐标(python版)
# -*- coding:utf-8 -*-'''test.py'''import cv2import randomimport argparseclicked = Falseg_rectangle = [0, 0, 0, 0]g_startPoint = [0, 0]def onMouse(event, x, y, flags, param): global clicked global g_rectangle global g_startPoint
2021-05-28 10:14:52 2647 2
原创 snprintf / printf 乱码问题
#include <iostream>#include <stdio.h>using namespace std;//这个例子是正常的代码,运行不会出现乱码的int main( int argc, char *argv[] ){ char roifilename[256]; string filename = "love"; int nameIdx = 1; snprintf(roifilename, sizeof(roifilename), "/home.
2020-07-23 16:45:24 1047
原创 在实时rtsp视频上画出区域(python版)
# -*- coding:utf-8 -*-'''test.py'''import cv2import randomimport argparseclicked = Falseg_rectangle = [0, 0, 0, 0]g_startPoint = [0, 0]def onMouse(event, x, y, flags, param): global clicked global g_rectangle global g_startPoint if eve...
2020-07-14 17:51:22 2799
原创 得到毫秒级别的时间戳
test.cpp#include <iostream>#include <stdio.h> #include <sys/time.h>#include <stdint.h>using namespace std;int64_t getCurrentTime(){ struct timeval tv; ...
2019-08-15 20:04:28 437
原创 ubuntu16.04下cuda,cudnn的安装与卸载
cuda的下载地址:https://developer.nvidia.com/cuda-toolkitcudnn的下载地址:https://developer.nvidia.com/rdp/cudnn-download下载相应的版本就可以啦,我这边下载的cuda是deb文件。1.cuda的安装与卸载安装(以cuda9.0为例):sudo dpkg -i cuda-repo-...
2019-04-17 10:28:24 2098 2
原创 ubuntu16.04系统下安装Oracle VM VirtualBox 用于虚拟win10系统
1.安装Oracle VM VirtualBoxsudo apt-get install virtualbox在ubuntu中的搜索启动virtualbox,启动2.启动之后,点击“新建”,输入名称“Win10”选择适合自己的系统,我这边选择的是“Windows 10(64-bit)”, 点击“下一步”设置内存大小,根据自己的系统设置,点击“下一步”...
2019-04-14 16:39:59 1423
原创 激励函数的绘制
import numpy as npimport tensorflow as tfimport matplotlib.pyplot as pltx_vals = np.linspace(start=-10.,stop=10., num=100)with tf.Session() as sess: y_logis =sess.run(tf.add(1.0/(1+np.exp(-x_va...
2018-06-15 13:46:08 552
原创 神经网络训练手写字集
import matplotlib.pyplot as pltfrom sklearn import neural_networkfrom sklearn.datasets import load_digits# 加载数据集digits = load_digits()X = digits.dataY = digits.target# 过拟合:增加训练样本train_x = X...
2018-05-30 09:31:22 635
原创 针对testSetRBF2.txt中数据,使用高斯核函数,进行SVM分类,画图。
testSetRBF2.txt# 2. 针对testSetRBF2.txt中数据,使用高斯核函数,进行SVM分类,画图并标记出支持向量。from numpy import *import matplotlib.pyplot as pltfrom sklearn import svm# 加载数据集def loadDataSet(filename): dataMat = [];...
2018-05-29 12:58:31 1180
原创 针对testSet.txt中数据,使用SVM进行分类,并画出分隔结果,标出支持向量。
训练集:testSet.txt# 1. 针对testSet.txt中数据,使用SVM进行分类,并画出分隔结果,标出支持向量。from numpy import *import matplotlib.pyplot as pltfrom sklearn import svm# 加载数据集def loadDataSet(filename): dataMat = []; labelM...
2018-05-28 20:39:28 2692
原创 高斯核函数应用
# 导入所使用的包import numpy as npimport pandas as pdimport tensorflow as tf# 输入空间iris = pd.read_csv('iris.txt', header=None) # 数据特点:没有头x = iris.iloc[:, :4].values # 获取样本的特征值y = iris.iloc[:, 4]....
2018-05-28 20:27:20 1499 2
翻译 最近看到一篇非常好的文章,想把它翻译成英文
翻译:Summary of advanced applications of neural network and artificial intelligenceThis paper is a comprehensive article, which introduces the concepts and application of artificial intelligence and neu...
2018-04-22 21:32:42 1351
原创 Python网络爬虫——把一个网页中所有的链接地址提取出来(去重)
# 把一个网页中所有的链接地址提取出来。运行环境Python3.6.4-实现代码:import urllib.requestimport re#1. 确定好要爬取的入口链接url = "http://blog.csdn.net"# 2.根据需求构建好链接提取的正则表达式pattern1 = '<.*?(href=".*?").*?'#3.模拟成浏览器并爬取对应的网页 谷歌浏览器...
2018-04-21 11:50:25 34555 3
原创 jQuery,选择喜欢的水果
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>jQuery</title> <script src="../js/jquery.js"></script> &
2018-04-16 20:46:33 2083
原创 用(js+html)实现三角形的打印
代码实现:<!DOCTYPE><html><head><meta charset="utf-8"><title>三角形</title><script type="text/javascript">var t=prompt("请输入一个整数",&
2018-04-12 08:27:12 5002 1
原创 用js实现编辑距离算法
问题描述:给出两个单词str1和str2,写一个函数计算出将str1 转换为str2的最少操作次数。你总共三种操作方法:1、插入一个字符2、删除一个字符3、替换一个字符格式:输入行输入两个字符串 str1 和 str2,最后输出将 str1 转换为 str2的最少操作次数。例如:输入word1 = "sailn" word2 = "failing'"输出3代码实现:<!DOCTYPE htm...
2018-04-11 20:38:38 765
原创 如何用(html+js)创建一个动态的时钟
<!DOCTYPE html><html><head> <title>动态时钟</title> <meta charset="utf-8"> <script type="text/javascript"> function disptime(){ v
2018-04-11 10:19:33 6020
原创 如何用html+css做一颗圣诞树
<!DOCTYPE html><html><head> <title>demo</title> <meta charset="utf-8"> <style type="text/css"> .div1{ border-style: solid
2018-04-09 08:24:37 19041 5
原创 html5中怎样从一堆图标中选出想要的那一个(反向偏移)
原图:用HTML处理后:代码:<!DOCTYPE html><html><head> <title>CSS</title> <meta charset="utf-8"> <style type="text/css"> div{ background-
2018-04-04 17:32:19 628
原创 怎样用HTML做一份精美的简历(html5+css)
先来看一下效果图:代码:index.html<!DOCTYPE html><html><head> <title>简历二</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css"
2018-04-04 08:28:38 49519 7
原创 怎样访问除了base以外的页面,html
首先有两个html文件001.html和index.html001.html:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>base 元素-1</title> <base href="http://www.bai
2018-04-03 08:30:49 207
原创 python3,切图片
切图片:import contextlibfrom urllib import requestwith contextlib.closing(request.urlopen("http://mm.taobao.com/json/request_top_list.htm?type=2&page=4"))as front_page: for line in front_page: ...
2018-04-01 11:52:13 444
原创 python 基础知识一(运行方式,安装三方库等)
一、运行python的三种方式:1.在交互模式下编写代码: win+r键,输入cmd,进入python,开始编写python代码即可注意:退出时有两种方式:(1)使用exit()命令(2)ctrl+z,回车2.python文件脚本(模块)创建.py文件,在该文件所在的位置的空白出,shift键+鼠标右键,点击在此处打开命令窗口输入:python demo.py3.集成开发环境(IDE)PyC...
2018-03-24 10:20:47 275
原创 python3 文件file的相关知识点
一、文件file一些方法解读:1.read([参数]) #打开文件a.txt,例如a中的内容为:aaaabbbbf = open('a.txt', 'r')#读取5个字节,换行也算一个字节print(f.read(5))# aaaab#从上一步读到的位置往后读,读取所有的print(f.read())#bbb2.readline([size]) vs readlines([s...
2018-03-20 20:36:38 256
原创 python3中对类,对函数进行测试的脚本(单元测试)
先来看一下单元测试的概念:单元测试:单元测试是用来对一个模块、一个函数或者一个类来进行正确性检验的测试工作。一、对函数进行测试 # 要测试的函数: import unittest def sum(x, y): return x + y def sub(x, y): return x - y # 测试该函数的测试类class mytest...
2018-03-20 18:39:31 1985
原创 你还为给自己的IT团队起名字,写口号烦恼吗?(较为流行的团队名称)
1.正式的团队名称:X之队,如云之队,山之队,梦之队,水之队,聚星团队2.有趣的团队名称:欢乐斗地组,基因重组,如来佛组,吴彦组3.网络流行团队名称:红鲤鱼与绿鲤鱼,超神战队,double kill4.还可以从自己组员的名字中选几个字组成好听的团队名字哦口号:1.越努力越幸运2.生命不止,奋斗不息3.You can!4.超越梦想一起飞!5.相遇相知,未来同在6.出拳,不为了打败别人,而为了战胜自己...
2018-03-19 21:25:32 35062 1
原创 python3中如何找到模块文件
python3.5的路径和pycharm的路径不一样,下面先从pycharm开始:一、在pycharm中怎样处理(python搜索模块的路径)1.从pycharm控制台导入模块sys.path.append(路径)当运行上面的的代码时会报错,需要在控制台上添加路径:例如:sys.path.append('F:\\basetest\\classtest\\')2.从pycharm非控制台导入模块有四...
2018-03-19 18:31:55 2170
pptp-1.10.0.tar.gz
2020-11-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人