
python
.云哲.
向善,求实,藏锋,隐智,戒欲,省身,慎言。
展开
-
【python】pickle
pickle原创 2022-10-14 15:14:40 · 296 阅读 · 0 评论 -
【python】faiss
faiss原创 2022-09-16 14:29:30 · 968 阅读 · 0 评论 -
【Python】yolo_to_voc
yolo_to_voc原创 2022-08-29 17:09:27 · 861 阅读 · 0 评论 -
【python】国内anaconda源
anaconda源原创 2022-07-28 10:35:33 · 2745 阅读 · 0 评论 -
【python】根据进程名,删除进程
python原创 2022-06-04 20:25:45 · 834 阅读 · 0 评论 -
【Pyhton】生成voc xml标签
1.voc模板标签2.python代码原创 2022-04-24 21:36:43 · 569 阅读 · 1 评论 -
【python】 np转base64, base64转np
def numpy_to_base64(image_np): data = cv2.imencode('.jpg', image_np)[1] image_bytes = data.tobytes() image_base4 = base64.b64encode(image_bytes).decode('utf8') return image_base4def base64_to_numpy(): img_bs64 = base64.b64decode(img_bs64原创 2022-04-18 20:54:33 · 3640 阅读 · 0 评论 -
【Python】汉语信号,LPC估计共振峰
0.介绍1.安装pip install scikits.talkbox2.使用3.参考https://www.cnpython.com/qa/79487原创 2022-02-18 15:19:05 · 720 阅读 · 0 评论 -
【python】office操作,doc转docx、ppt,pptx转pdf,pdf转txt
1.安装libofficesudo apt-get install libreofficesudo apt-get install libreoffice-l10n-zh-cn libreoffice-help-zh-cn2.转换soffice --headless --convert-to txt:Text 123.doc3.中文编码原创 2022-01-12 11:37:36 · 1778 阅读 · 0 评论 -
【python】datetime类型转换
import pandas as pdimport datetime as dtimport csvimport time# datetime对象之差,计算持续时间def cal_time(end, start): # 结束时间转datetime对象 end = end.strftime("%H:%M:%S") end = dt.datetime.strptime(end, "%H:%M:%S") # 开始时间转datetime对象 start = st原创 2021-12-28 14:14:04 · 2794 阅读 · 0 评论 -
【python】zeromq
1,介绍2,安装sudo apt-get install libzmq3-dev # 安装zmqpip install pyzmq # 安装zmq队列python接口原创 2021-06-02 14:53:28 · 238 阅读 · 0 评论 -
【python】cupy
1,简介 CuPy: NumPy-like API accelerated with CUDA。CuPy是NumPy兼容多维数组在CUDA上的实现。这个包(cupy)是一个源发行版。对于大多数用户,建议使用预构建的wheel 分布。 CuPy是一个开源矩阵库,使用NVIDIA CUDA加速。CuPy使用Python提供GPU加速计算。CUPY使用CUDA相关库,包括 CuBLAS、CUDNN、Curand、Cuo原创 2021-04-01 16:56:53 · 484 阅读 · 0 评论 -
【Python】pendulum
0,简介Pendulum是一个简化日期时间操作的Python包。它提供的类可以作为本地类的替代(它们从本地类继承)。特别注意确保正确处理时区,并基于底层tzinfo实现。例如,所有比较都是在UTC或datetime所在的时区内进行的。1,安装pip install pendulum2,代码import pendulumday = pendulum.now().strftime("%Y%m%d")past = pendulum.now().subtract(years=1).strftim原创 2021-03-09 16:01:07 · 554 阅读 · 0 评论 -
【Pytorch】安装mish_cuda
git clone https://github.com/thomasbrandon/mish-cudacd mish-cudacp external/CUDAApplyUtils.cuh csrc # cuda > 11.0python setup.py build install原创 2021-02-20 15:10:43 · 5333 阅读 · 7 评论 -
【环境搭建】pybind11 cmake编译
1,pybind11简介2,代码原创 2021-01-20 18:07:07 · 4435 阅读 · 0 评论 -
【python】计算miou
详细代码import numpy as npdef compute_miou(pred, target, nclass): mini = 1 # 计算公共区域 intersection = pred * (pred == target) # 直方图 area_inter, _ = np.histogram(intersection, bins=2, range=(mini, nclass)) area_pred, _ = np.histogram(p原创 2020-12-10 16:55:18 · 2784 阅读 · 0 评论 -
【Python】phonenumbers
0,简介phonenumbers是由google公司开发的电话查询系统。1,安装pip install phonenumbers2,应用>>> import phonenumbers>>> from phonenumbers import geocoder, carrier>>> number = "+8618301307050">>> phone = "+8618301307050">>> num原创 2020-12-03 17:03:01 · 643 阅读 · 0 评论 -
【Python】协程
协程原创 2020-11-26 15:43:56 · 115 阅读 · 0 评论 -
【Python】线程
线程原创 2020-11-26 15:43:24 · 93 阅读 · 0 评论 -
【Python】进程
# -*- coding: utf-8 -*-import multiprocessingfrom multiprocessing import Pool, Managerimport os, timedef reader(q): print("reader 启动(%s),父进程为(%s)" % (os.getpid(), os.getppid())) for i in range(q.qsize()): print("reader从Queue获取到消息:%s" %原创 2020-11-26 15:42:41 · 102 阅读 · 0 评论 -
【python】labelme
win10pip install pyqt5pip install pyqt5-toolspip install lxmlpip install labelmelinuxpip install pyqt5pip install labelmemacpip install pyqt5pip install pyside2pip install labelme原创 2020-11-10 10:32:33 · 401 阅读 · 0 评论 -
【python】opencv透视变换
透视变换图片内的点也映射过去sudoku.jpg# -*- coding: utf-8 -*-import cv2 as cvimport numpy as npdef perspective_transformation(Image, total_points_list): '''透视变换''' pts1 = np.float32([[56, 65], [368, 52], [28, 387], [389, 390]]) pts2 = np.float32([[0,原创 2020-10-26 17:31:16 · 427 阅读 · 0 评论 -
【Python】FastAPI
1,简介 FastAPI是一种现代,快速(高性能)的Web框架,用于基于标准Python类型提示使用Python 3.6+构建API。2,安装pip install fastapipip install uvicorn3,应用3.1 main.pyfrom fastapi import FastAPIapp = FastAPI()@app.get("/index")async def index(): return "hello原创 2020-06-10 14:09:32 · 1464 阅读 · 0 评论 -
【Python】 uwsgi
1,介绍2,安装conda install -c conda-forge uwsgi2.1 报错,gcc版本问题linux-gnu/libpython3.6m.a -lutil -lcrypt lto1: fatal error: bytecode stream generated with LTO version 6.0 instead of the expected 4.2 compilation terminated. lto-wrapper: fatal error原创 2020-06-09 00:17:48 · 470 阅读 · 0 评论 -
【python】pybind11 make编译
export PYTHONPATH="/path/that/contains/your/so":"${PYTHONPATH}"原创 2021-01-20 18:06:12 · 1637 阅读 · 0 评论 -
【python】RabbitMQ
https://www.rabbitmq.com/tutorials/tutorial-one-python.html原创 2020-04-07 09:39:02 · 183 阅读 · 0 评论 -
【python】ActivaMQ
1,简介原创 2020-04-07 09:38:05 · 154 阅读 · 0 评论 -
【Python】apscheduler
1,介绍原创 2020-03-16 15:25:37 · 246 阅读 · 0 评论 -
【Python】pyppeteer
https://blog.youkuaiyun.com/freeking101/article/details/93331204原创 2020-03-12 16:47:23 · 257 阅读 · 0 评论 -
【Python】RSA
https://www.jianshu.com/p/2d354e9c31afhttps://www.cnblogs.com/lanston1/p/11875706.html原创 2020-03-12 15:21:04 · 166 阅读 · 0 评论 -
【Python】MD5
https://www.cnblogs.com/lanston1/p/11025881.html原创 2020-03-12 15:19:57 · 132 阅读 · 0 评论 -
【Python】AES加密与解密
https://www.cnblogs.com/niuu/p/10107212.html原创 2020-03-12 15:03:30 · 184 阅读 · 0 评论 -
【Python】程序变为exe执行文件
1,简介2,安装3,应用4,参考原创 2020-03-12 13:46:39 · 275 阅读 · 0 评论 -
【Python】aiohttp
1,简介 asyncio可以实现单线程并发IO操作。如果仅用在客户端,发挥的威力不大。如果把asyncio用在服务器端,例如Web服务器,由于HTTP连接就是IO操作,因此可以用单线程+coroutine实现多用户的高并发支持。 asyncio实现了TCP、UDP、SSL等协议,aiohttp则是基于a...原创 2020-03-12 11:16:48 · 467 阅读 · 0 评论 -
【Python】Levenshtein
1,简介2,安装conda install python-Levenshtein# pip install python-Levenshtein3,计算字符串的相似度3.1 汉明距离,要求str1和str2必须长度一致。是描述两个等长字串之间对应位置上不同字符的个数。>>> Levenshtein.hamming('abc','cba')2>>>...原创 2020-03-12 10:16:37 · 2302 阅读 · 0 评论 -
【Python】json与string相互转化
1 json->string# -*- coding: utf-8 -*-import jsonstudent = {"id":"123", "name":"122", "age":18}print(type(student))print(student)print('-'*10)result = json.dumps(student)print(type(result...原创 2020-02-27 15:40:53 · 4225 阅读 · 0 评论 -
【Python】list与str类型转换
1,str -> list>>> import ast>>> data = "[123, 456, 789]" # 输出原始数据的类型>>> print(type(data))<class 'str'>>>> data_new = ast.literal_eval(data) # 输出新数据的类型...原创 2020-02-26 22:19:22 · 359 阅读 · 0 评论 -
【Python】selenium
0,介绍1,开源免费,社区活跃2,UI浏览器测试,火狐,谷歌3,支持多语言,python,java,php,js等4,跨平台,windows,mac,Linux等1,安装pip install selenium...原创 2020-02-12 14:44:54 · 132 阅读 · 0 评论 -
【Python】调用lua
1,引言lua本身又是嵌入语言。在语言本身上又一定的局限性。所以我打算把lua嵌入到python/java中。做调研的时候,java的嵌入较为麻烦,出现了各种问题。后来确定用python来作这个环境。这样能用上python 的协程、多线程。2,环境搭建pip install lupa3,案例3.1 test.luafunction test1(params) return '...原创 2020-01-14 18:26:41 · 702 阅读 · 0 评论 -
【Python】cnocr的使用
1,介绍cnocr于2019年7月25日开源,以下是使用介绍。2,安装pip install cnocr3,使用from cnocr import CnOcrocr = CnOcr()path = r"D:\server\cnocr\examples\rand_cn1.png"res = ocr.ocr_for_single_line(path)print(res)按住Ct...原创 2020-01-06 18:22:45 · 6929 阅读 · 0 评论