- 博客(53)
- 资源 (3)
- 收藏
- 关注
原创 tensorrt dockerfile
cuda10 # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at##
2022-04-01 17:48:09
893
原创 Maven打包java、scala
Java打包<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/
2022-01-07 17:08:13
518
原创 spark部署TF、 Torch深度学习模型
模型训练TF(2.1)import tensorflow as tffrom tensorflow.keras import layers,modelsimport tensorflow as tfimport numpy as npimport pandas as pdimport osdef predict(): x = pd.DataFrame({'x0': [0.1], 'x1': [0.2]}) # x = np.random.randn(1, 2) m
2021-12-20 19:23:37
4112
3
原创 pyhive、pyspark配置
pyhive检查HiveServer2HiveServer2的启动$HIVE_HOME/bin/hiveserver2测试客户端连接$HIVE_HOME/bin/beeline!connect jdbc:hive2://localhost:10000报错:User: xxx is not allowed to impersonate anonymous,进行如下配置hadoop配置<!--解决beeline连接hive权限不足的问题--><!--设置只允
2021-10-20 13:10:15
666
原创 logging使用笔记
logging日志框架主要包括四部分:Loggers: 可供程序直接调用的接口,app通过调用提供的api来记录日志Handlers: 决定将日志记录分配至正确的目的地Filters:对日志信息进行过滤, 提供更细粒度的日志是否输出的判断Formatters: 制定最终记录打印的格式布局日志级别DEBUG:详细信息,一般只在调试问题时使用INFO:证明事情按预期工作WARNING:某些没有预料到的时间提示,或者在将来可能会出现的问题提示。例如:磁盘空间不足,但是软件还是会照常运作E
2021-09-24 09:59:10
168
原创 tensorRT 与 torchserve-GPU性能对比
实验对比前端时间搭建了TensorRT 、 Torchserve-GPU,最近抽时间将这两种方案做一个简单的实验对比。实验数据Cuda11.0、RTX3090 24G、Resnet50TensorRT 、Torchserve-GPU各自一张卡搭建10进程接口,感兴趣的可以查看我个人其他文章。30进程并发 、2000 1200*720总量数据TensorRT 的部署使用了RTX3090 10进程Torchserve-GPU的部署使用了RTX3090 10进程Torchserve-CPU的部署
2021-09-15 16:33:02
1932
4
原创 supervisord + uwsgi / nginx
supervisor配置安装supervisorpip install supervisor生成配置文件echo_supervisord_conf > /etc/supervisord.conf修改配置文件vim /etc/supervisord.conf;[include];files = relative/directory/*.ini#改为[include]files = /etc/supervisor/*.confinclude可以理解为包含,它的意
2021-09-15 13:23:45
161
原创 nginx学习笔记
nginx安装安装apt-get install nginx启动nginx关闭nginx -s stop重启(更新完配置之后需要重启)nginx -s reloadnginx配置默认配置信息会安装在 /etc/nginx下,我们可以cat nginx.conf看一下user www-data;# 进程数量worker_processes 4;pid /run/nginx.pid;include /etc/nginx/modules-enabled/*.c
2021-09-15 11:32:05
135
原创 图像叠加合成
PILfrom PIL import Imagedef img_trans(): img98 = './banner/IPADbanner1080×380/98.png' img99 = './banner/IPADbanner1080×380/99.png' img98 = Image.open(img98) img99 = Image.open(img99) target = Image.new('RGB', (2393, 727), (255,
2021-07-21 16:10:10
595
原创 Apache HTTP server benchmarking tool
测试代码porn_txt='porn.txt'porn_url='http://thserving.cc.163.com:18080/predictions/resnet18'char_txt='char.txt'char_url='http://thserving.cc.163.com:18080/predictions/VltCharDetect'api_txt='api.txt'api_url='http://innerapi.cc.163.com/v1/paintdect/detec
2021-07-13 21:20:19
192
原创 torch Lr调整
import matplotlib.pyplot as pltfrom torch.optim import *import torch.nn as nnclass net(nn.Module): def __init__(self): super(net, self).__init__() self.fc = nn.Linear(1,10) def forward(self,x): return self.fc(x)lr_lis
2021-07-08 20:09:15
332
原创 labelImg xml >> yolotxt
import xml.etree.ElementTree as ETimport os, globclasses = ['1', '2', '3', '7']def convert(size, box): dw = 1. / size[0] dh = 1. / size[1] x = (box[0] + box[1]) / 2.0 y = (box[2] + box[3]) / 2.0 w = box[1] - box[0] h = box[3]
2021-07-04 00:43:07
99
原创 图像相似度对比
import cv2from PIL import Imagefrom numpy import average, dot, linalgfrom skimage.metrics import peak_signal_noise_ratio as psnrfrom skimage.metrics import structural_similarity as ssimdef calc_similar(image1, image2): def hist_similar(lh, rh):.
2021-05-19 11:23:46
314
原创 tensorflow各种模型文件的生成
一,pb文件import osimport tensorflow as tffrom tensorflow.python.framework import graph_utildef freeze_graph(ckpt, output_graph): # 指定输出的节点名称,该节点名称必须是原模型中存在的节点 output_node_names = "predictions" saver = tf.train.import_meta_graph(ckpt.model_c
2021-04-02 11:47:40
775
原创 tensorflow-serving部署
一.镜像拉取测试docker pull tensorflow/servinggit clone https://github.com/tensorflow/servingTESTDATA="$(pwd)/serving/tensorflow_serving/servables/tensorflow/testdata"docker run -t --rm -p 8501:8501 \ -v "$TESTDATA/saved_model_half_plus_two_cpu:/mo
2021-04-02 11:36:29
310
原创 matplotlib随手笔记
导入import matplotlib.pyplot as plt基本图表用plot方法画出x=(0,10)间sin的图像x = np.linspace(0, 10, 30)plt.plot(x, np.sin(x));用点加线的方式画出x=(0,10)间sin的图像plt.plot(x, np.sin(x), '-o');用scatter方法画出x=(0,...
2021-04-02 11:03:32
215
原创 Numpy曲线拟合求取极值点
import jsonimport numpy as npimport matplotlib.pyplot as pltfrom scipy.interpolate import make_interp_splinefrom scipy import signaldef prepare(data): data = data[1:-1].split(',') xs, ys = [], [] for i in data: if 'x:' in i: .
2021-03-28 18:41:12
1789
原创 cv2监听鼠标事件画图
import cv2import numpy as npdef draw_circle(event, x, y, flags, p): global ix, iy, f if event == cv2.EVENT_MOUSEMOVE and flags == cv2.EVENT_FLAG_LBUTTON: f.write('{}\t{}\n'.format(x,y)) cv2.circle(img, (x, y), 3, (0, 0, 0), -1).
2021-03-09 15:06:17
546
1
原创 base64 > PIL/CV2编解码
base64 <> PILimport base64import cv2import numpy as npfrom io import BytesIOfrom PIL import Imageimg = Image.open('./nsfw/1.jpg')output_buffer = BytesIO()img.save(output_buffer, format='JPEG')byte_data = output_buffer.getvalue()modelImg
2021-03-04 11:02:02
391
1
原创 PIL.Image、cv2、skimage 的区别
import cv2from PIL import Imageimport matplotlib.pyplot as pltimport numpy as npimport skimage.iodef PILImageToCV(imagePath): # PIL Image转换成OpenCV格式 img = Image.open(imagePath) plt.imshow(img) img = cv2.cvtColor(np.asarray(img), cv2..
2021-01-16 14:09:05
387
原创 安装scala、sbt、spark
一.安装scalamaven下载链接sudo tar -zxvf scala-2.12.6.tgz -C /optsudo mv scala-2.12.6 scalasudo vim /etc/profile#scala environmentexport SCALA_HOME=/opt/scalaexport PATH=${SCALA_HOME}/bin:$PATHsudo source /etc/profile二.安装mavensudo tar zxvf ...
2020-07-26 20:10:45
153
原创 ubuntu搭建hadoop、mysql、hive环境
本机环境为java:jdk-8u251-linux-x64.tar jdk下载链接ubuntu:ubuntu-18.04.4-desktop-amd64 hadoop:hadoop-3.2.0.tar hadoopmysql:5.7.30 ...
2020-06-23 12:09:17
1118
1
原创 hql语言学习
Data Definition StatementsOverviewHiveQL DDL statements are documented here, including:CREATE DATABASE/SCHEMA, TABLE, VIEW, FUNCTION, INDEX DROP DATABASE/SCHEMA, TABLE, VIEW, INDEX TRUNCATE TABLE ALTER DATABASE/SCHEMA, TABLE, VIEW MSCK REPAIR TAB
2020-06-17 22:01:34
825
原创 conda & pip
添加官方channel镜像源:conda config --add channels biocondaconda config --add channels conda-forge清华镜像源conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda conf...
2020-04-15 16:04:29
439
原创 模式匹配BF、KMP、BM、Sunday
BF模式匹配参考介绍最好情况的复杂度为O(n+m);最坏情况的复杂度为O(n*m)def strmatch(a,b): for i in range(len(a)): if len(a)<len(b): break index=i for j in range(len(b)): ...
2020-04-13 16:00:12
173
原创 实用数据结构知识点
线性表动态与静态数据结构在计算机内存中的存储方式有何不同?各有何优缺点?参考答案:静态存储方式(顺序存储)——逻辑相邻,物理相邻。优点:便于数据的随即存取,结点存储利用率高(不需要存储指针);缺点:存取数据时要移动大量的元素,由于事先不知道存储结点的最大个数,所以应该分配尽可能大的存储空间,从而可能会造成空间浪费!动态存储方式(链式存储)——逻辑相邻,物理不一定相邻。优点:动态分配和释放存...
2020-04-13 15:48:34
176
原创 torch随手笔记
张量创建#创建一个未初始化的5x3张量x = torch.empty(5, 3)#创建一个随机初始化的5x3张量x = torch.rand(5, 3)#创建一个5x3的0张量,类型为longx = torch.zeros(5, 3, dtype=torch.long)#直接从数组创建张量x = torch.tensor([5.5, 3])#从已有的张量创建相同维度的新张量,...
2020-04-01 15:54:04
427
原创 keras随手笔记
模型创建from keras.models import Sequentialfrom keras.layers import Dense, Activation#序列模型 Sequentialmodel = Sequential()model.add(Dense(32, input_shape = (784,)))model.add(Activation('relu'))mod...
2020-04-01 11:39:14
104
原创 sklearn中KFold,StratifiedKFold的区别
StratifiedKFold不会出错import numpy as npfrom sklearn import model_selectionfrom sklearn.model_selection import KFold,StratifiedKFoldx = np.array(list(range(10)))y = np.array(list([0]*5+[1]*5))...
2020-03-27 22:19:38
197
原创 argparse & linux & git
pippip install -i https://pypi.tuna.tsinghua.edu.cn/simple --user pandassudo apt-get install python-pip python-dev python-virtualenvvirtualenv --system-site-packages ~/tensorflowactivate ~/...
2020-03-20 18:10:31
545
转载 动态规划--股票算法
买卖股票的最佳时机给定一个数组,它的第i个元素是一支给定股票第i天的价格。如果你最多只允许完成一笔交易(即买入和卖出一支股票),设计一个算法来计算你所能获取的最大利润。注意你不能在买入股票前卖出股票。例题输入:[7,1,5,3,6,4]输出:5解释:在第2天(股票价格=1)的时候买入,在第5天(股票价格=6)的时候卖出,最大利润=6-1=...
2020-02-02 14:01:34
1366
1
原创 哥德马赫猜想
import mathdef is_prime(number): # 判断是否为素数 sqrt = int(math.sqrt(number)) for j in range(2, sqrt + 1): # 从2到number的算术平方根迭代 if number % j == 0: # 判断j是否为number的因数 return ...
2019-12-08 22:26:57
293
原创 Word编辑要则
标题设置文本中经常需要设置标题,方便整体的编辑分节与分页分节是为了在不同的节中使用不同的格式分布分页只是为了将内容直接移到下一页页码先将光标点击到要设置页码的第一页要想在不同的节中设置不同的的页码格式,就直接在不同的节的第一页进行设置。添加目录标题设置完成之后就可以直接从引用中添加目录页眉与页脚设置页眉的页面和设置页眉的页面要用...
2019-11-22 16:22:16
155
原创 mAP计算方式
mAP计算方式Accuracy:准确率准确率=预测正确的样本数/所有样本数,即预测正确的样本比例(包括预测正确的正样本和预测正确的负样本,不过在目标检测领域,没有预测正确的负样本这一说法,所以目标检测里面没有用Accuracy的)。Precision:查准率Precision表示某一类样本预测有多准。Precision针对的是某一类样本,如果没有说明类别,那么Precisi...
2019-10-25 16:45:44
2229
原创 F1score/P-R曲线/ROC曲线/AUC
1.分类正确的样本占总样本个数的比例。2.TP/FP/FN/TN1)True positive(TP): 真正例,将正类正确预测为正类数;2)False positive(FP): 假正例,将负类错误预测为正类数;3)False negative(FN):假负例,将正类错误预测为负类数;4)True negative(TN): 真负例,将负类正确预测为负类数。3.Pre...
2019-10-25 15:51:53
6522
原创 决策树、随机森林、bagging、boosting、Adaboost、GBDT、XGBoost总结
一.决策树决策树是一个有监督分类模型,本质是选择一个最大信息增益的特征值进行输的分割,直到达到结束条件或叶子节点纯度达到阈值。根据分割指标和分割方法,可分为:ID3、C4.5、CART算法。1.ID3算法:以信息增益为准则来选择最优划分属性信息增益的计算是基于信息熵(度量样本集合纯度的指标)信息熵越小,数据集X的纯度越大。假设基于数据集D上建立决策树,数据有K个类别:...
2019-10-24 15:21:38
209
Gale-Shapley算法.pptx
2020-03-26
darknet框架release cpu版
2018-11-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人