![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 72
curry dog
自然语言处理
展开
-
python 和 c++交互
setup 编写#!/usr/bin/env python# example2from distutils.core import setupsetup(name='Distutils', version='1.0', description='Python Distribution Utilities', author='Greg Ward', author_email='gward@python.net', url='https://原创 2020-10-29 12:39:35 · 1091 阅读 · 1 评论 -
pytorch 杂记
切片a=torch.tensor([[1,2,3],[4,5,6],[7,8,9]])print(a[[[1],[0]],[[1],[0]]])tensor([[5], [1]])broadcasta=torch.tensor([[1],[2],[3]])b=torch.tensor([1,2,3])print(a+b)tensor([[2, 3, 4], [3, 4, 5], [4, 5, 6]])原创 2020-11-06 22:21:54 · 676 阅读 · 0 评论 -
python opencv 读取显示深度图
import cv2import numpy as npimport skimagedepth_filename="20200803 210004img_depth.png"imgOri = cv2.imread(depth_filename, -1)depth=cv2.split(imgOri)[0]depth[depth>2000]=0depth=depth/2000.0000cv2.imshow('imgOri',depth)cv2.waitKey(0)原创 2020-08-08 19:36:58 · 6666 阅读 · 4 评论 -
python 语法杂记
模块inspectdef v2(): for frame in inspect.stack(): print(frame[3])def v1(): v2()def main(): v1()if __name__ == "__main__": main()v2v1main<module>语法闭包用比较容易懂的人话说,就是当某个函数被当成对象返回时,夹带了外部变量,就形成了一个闭包。看例子装饰器装饰器函数其实是这样一个接原创 2020-08-04 15:23:54 · 273 阅读 · 1 评论 -
numpy函数
numpy.any()Test whether any array element along a given axis evaluates to True.Returns single boolean unless axis is not None>>> np.any([[True, False], [False, False]], axis=0)array([ True, False], dtype=bool)numpy.nonzero()>>> x =原创 2020-06-15 09:41:52 · 308 阅读 · 0 评论 -
pycharm远程运行tensorflow 报错找不到ibcudart.so
解决方法: 手动配置cuda环境变量:原创 2020-07-28 20:32:05 · 190 阅读 · 0 评论 -
python socket发送接收图像
def recvData(sock, count): data = b'' while len(data) < count: packet = sock.recv(count - len(data)) if not packet: return None data += packet return datadef sendData(sock, data): totalsent = 0 m原创 2020-07-11 22:27:41 · 1100 阅读 · 0 评论