随笔分类 -  Python

摘要:win7 sp1 + vs2019环境下执行pip install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'报出 cl: 命令行 error D8021 :无效的数值参数“/Wno-cpp” 错误。 阅读全文
posted @ 2020-02-13 13:40 Dsp Tian 阅读(1736) 评论(0) 推荐(0)
摘要:keras生成的网络结构如下图: 代码如下: 拟合结果: 阅读全文
posted @ 2018-09-21 16:37 Dsp Tian 阅读(7100) 评论(0) 推荐(1)
摘要:原始论文中的网络结构如下图: keras生成的网络结构如下图: 代码如下: 50次迭代,识别率在97%左右: 相关测试数据可以在这里下载到。 阅读全文
posted @ 2018-09-14 09:40 Dsp Tian 阅读(3297) 评论(0) 推荐(0)
摘要:使用keras时输出网络结构需要用到pydot,总是安装失败,最后按照下面这样的步骤成功了。 1.安装graphviz:pip install graphviz 2.安装graphviz软件,地址在:https://graphviz.gitlab.io/_pages/Download/Downloa 阅读全文
posted @ 2018-09-13 14:21 Dsp Tian 阅读(2666) 评论(0) 推荐(0)
摘要:卷积神经网络的结构我随意设了一个。 结构大概是下面这个样子: 代码如下: 最终在测试集上识别率在99%左右。 相关测试数据可以在这里下载到。 阅读全文
posted @ 2018-09-13 10:14 Dsp Tian 阅读(2796) 评论(0) 推荐(0)
摘要:上次用Matlab写过一个识别Mnist的神经网络,地址在:https://www.cnblogs.com/tiandsp/p/9042908.html 这次又用Keras做了一个差不多的,毕竟,现在最流行的项目都是Python做的,我也跟一下潮流:) 数据是从本地解析好的图像和标签载入的。 神经网 阅读全文
posted @ 2018-09-12 16:31 Dsp Tian 阅读(1086) 评论(0) 推荐(0)
摘要:from pymouse import PyMouse m = PyMouse() a = m.position() #获取当前坐标的位置 print(a) m.move(50, 500) #鼠标移动到(x,y)位置 a = m.position() print(a) m.click(50, 50) 阅读全文
posted @ 2018-04-26 20:45 Dsp Tian 阅读(9367) 评论(0) 推荐(0)
摘要:'''python3读取excle数据''' import xlrd workbook = xlrd.open_workbook(r'test.xls', encoding_override='gbk') print(workbook.sheet_names()) sheet = workbook.sheet_by_name('Sheet 1') print(sheet.nrows, shee... 阅读全文
posted @ 2018-04-22 09:42 Dsp Tian 阅读(474) 评论(0) 推荐(0)
摘要:python.txt是百度百科上的一段: 生成的图片如下: 阅读全文
posted @ 2018-03-24 09:24 Dsp Tian 阅读(5873) 评论(0) 推荐(1)
摘要:import zlib import os ss = 's' * 1024 * 1024 #写入原始文件 file = open("src.dat", "wb") file.write(ss.encode()) file.close() #读取上一步原始的文件 file = open("src.dat", "rb") sss = file.read(os.path.getsize("... 阅读全文
posted @ 2018-03-04 11:36 Dsp Tian 阅读(549) 评论(0) 推荐(0)
摘要:对所使用的字符串类型调用encode()方法进行转换即可 阅读全文
posted @ 2018-03-04 11:36 Dsp Tian 阅读(888) 评论(0) 推荐(0)
摘要:import cv2 img = cv2.imread("lena.jpg") cv2.namedWindow("Image") cv2.imshow("Image", img) cv2.waitKey(0) cv2.destroyAllWindows() 阅读全文
posted @ 2018-03-04 11:35 Dsp Tian 阅读(505) 评论(0) 推荐(0)
摘要:import sqlite3 from datetime import datetime conn = sqlite3.connect('data.db') print("Opened database successfully") for i in range(100): time = datetime.now() conn.execute("INSERT INTO t... 阅读全文
posted @ 2018-03-04 11:35 Dsp Tian 阅读(643) 评论(0) 推荐(0)
摘要:from datetime import datetime from apscheduler.schedulers.blocking import BlockingScheduler def tick(): print(datetime.now()) if __name__ == '__main__': scheduler = BlockingScheduler(... 阅读全文
posted @ 2018-03-04 11:34 Dsp Tian 阅读(382) 评论(0) 推荐(0)
摘要:import threading import time class myThread (threading.Thread): #继承父类threading.Thread def __init__(self, threadID, name): threading.Thread.__init__(self) self.name = name ... 阅读全文
posted @ 2018-03-04 11:33 Dsp Tian 阅读(354) 评论(0) 推荐(0)
摘要:import requests import bs4 import urllib.request import urllib import os hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHT 阅读全文
posted @ 2018-03-04 11:31 Dsp Tian 阅读(513) 评论(0) 推荐(0)
摘要:源地址:http://www.cnblogs.com/thinksasa/archive/2013/08/26/3283695.html 方法:新建一个register.py 文件,把一下代码贴进去,保存 (代码来自:http://effbot.org/zone/python-register.ht 阅读全文
posted @ 2018-03-04 11:30 Dsp Tian 阅读(316) 评论(0) 推荐(0)
摘要:# -*- coding: cp936 -*- import sys,os,string d=0; path="F://test" srcfile=os.listdir(path) for i in srcfile: src=path+"//"+i dst=path+"//"+str(d)+".txt" os.rename(src,dst) d=d+1; ... 阅读全文
posted @ 2018-03-04 11:28 Dsp Tian 阅读(417) 评论(0) 推荐(0)
摘要:1.使用qt designer设计界面,保存为test1.ui: 2.使用pyuic4 test1.ui -o ui.py生成ui代码。 3.程序载入。 结果: 修改后: 阅读全文
posted @ 2017-09-23 10:53 Dsp Tian 阅读(2259) 评论(0) 推荐(0)
摘要:随便写写 阅读全文
posted @ 2017-09-23 10:53 Dsp Tian 阅读(771) 评论(0) 推荐(0)