深度学习项目
DLP
HJZ11
记录学习之路,欢迎交流
展开
-
Halcon-深度学习-缺陷检测
文章目录1.概述2.Halcon框架目标检测1.概述2.Halcon框架目标检测注意文件夹格式路径!!!原创 2021-08-04 16:31:57 · 495 阅读 · 0 评论 -
Halcon-深度学习初探
文章目录1.安装环境1.1 halcon1.2.Deep learning tool2.使用案例2.1 Deep learning tool案例2.2 Halcon参考案例1.安装环境1.1 halconhttps://www.mvtec.com/downloads下载步骤: 1. Full Version 1.9 GB---Halcon安装包 2. Deep Learning Data 1.2 GB 3. Deep Learning Core 1.6 GB1.2.Deep lea原创 2021-06-22 16:31:02 · 1775 阅读 · 1 评论 -
AI把图片转素描-Github项目Anime2Sketch
文章目录1.原址2.使用方法2.1 下载ZIP2.2 下载权重2.3 运行3 效果1.原址https://github.com/Mukosame/Anime2Sketch2.使用方法2.1 下载ZIP2.2 下载权重2.3 运行python test.py --dataroot=E:\01_hjz\datas\00-hjz\pictures --load_size=5123 效果...原创 2021-05-14 14:20:24 · 1599 阅读 · 2 评论 -
2020中国华录杯·数据湖算法大赛—定向算法赛(吸烟打电话检测)-tensorflow2.3-python3.6-迁移学习
1.inceptionV3"""python=3.6tf=2.3.1"""import osimport tensorflow as tffrom tensorflow.keras.models import *from tensorflow.keras.layers import *from tensorflow.keras.applications import *from tensorflow.keras.preprocessing.image import *from ten原创 2020-10-20 10:24:34 · 1335 阅读 · 6 评论 -
2020中国华录杯·数据湖算法大赛—定向算法赛(吸烟打电话检测)baseline-tensorflow2.3-python3.6
文章目录1.赛事背景1.主办方2.赛事介绍2.baseline2.1 文件夹结构2.2 demo1. 01_train_test_split.py2. 02_tf2_mobilev2_classes.py3. 03_predict.py3.问题及改进1.赛事背景1.主办方赛事链接2.赛事介绍 1. 【赛题描述】行为规范,即指某些特定的场景会对人物的行为做出特定的限制,比如加油站禁止吸烟,驾驶员禁止打电话,博物馆禁止拍照等。随着计算机人工智能的发展,这些禁止行为或者不文明行为都可通过基于视原创 2020-10-20 10:12:51 · 2715 阅读 · 12 评论 -
百度OCR文字识别API-试用
# -*- coding: utf-8 -*-import globfrom os import pathimport osfrom aip import AipOcrfrom PIL import Imagedef convertimg(picfile, outdir): '''调整图片大小,对于过大的图片进行压缩 picfile: 图片路径 outdir: 图片输出路径 ''' img = Image.open(picfile)原创 2020-08-13 11:45:54 · 2181 阅读 · 0 评论 -
Fashion_MNIST数据集-tensorflow代码练习
1.参考文章Dataset之Fashion-MNIST:Fashion-MNIST数据集简介、下载、使用方法之详细攻略fashion-mnist简介和使用及下载TensorFlow 学习(六)时尚(衣服、鞋、包等) Fashion MNIST识别fashion-mnist数据集下载至本地并使用tensorflow官网:Basic classification: Classify images of clothing2.demo...原创 2020-07-30 14:40:49 · 577 阅读 · 0 评论 -
Kaggle-Digit Recognizer-tensorflow
""""https://www.kaggle.com/villoro/cnn-with-tensorflow-dlfn-udacity/comments"""#1.Libraries and settingsimport numpy as npimport pandas as pdimport matplotlib.pyplot as pltimport matplotlib.cm as cm# %matplotlib inlineimport tensorflow as tfimpor原创 2020-07-30 10:15:58 · 220 阅读 · 0 评论 -
Kaggle-Digit Recognizer-DL-kaggle手写数字识别比赛-深度学习-tensorflow
文章目录1.比赛背景2.代码2.1导入包2.2 参数设置2.3 数据预处理2.3.1 读取数据2.3.2 查看数据并归一化2.3.4 查看图片2.3.4 标签one-hot2.3.5 数据集拆分2.4 神经网络模型搭建2.4.1 tf-NN描述2.4.2 权重初始化2.4.3 卷积层2.4.4 池化层2.4.5 占位符2.4.6 第一层卷积2.4.7 第二层卷积2.4.8 全连接层2.4.9 dropout2.4.10 Softmax layer2.4.11 损失函数-优化器-评估2.4.12 构建批次2.原创 2020-07-29 13:59:50 · 507 阅读 · 0 评论 -
3-Tensorflow-demo-Iris-softmax-tf实现鸢尾花数据多分类并可视化
import tensorflow as tfimport pandas as pdfrom sklearn.model_selection import train_test_splitfrom sklearn.preprocessing import StandardScalerimport osdef read_data(): iris = pd.read_csv(fi...原创 2019-12-29 16:23:13 · 646 阅读 · 0 评论 -
3-Tensorflow-demo_10_02-批量和Epoch实现MNIST并可视化
import tensorflow as tfimport pprintimport numpy as npfrom tensorflow.examples.tutorials.mnist import input_dataimport os"""批量和 SGD是绝配。 1、你需要将数据集划分成 批量数据;比如样本是1000个 你的批量大小128, 有7个128的b...原创 2019-12-05 21:45:44 · 186 阅读 · 0 评论 -
1-p01_arg_trans-python基础
def m(a, b): print('in m') a = 100 b = 200x = 1y = 2m(x, y)print(x, y)def m2(a): a[0] = 100x = [1, 2]m2(x)print(x)def m3(*a): for v in a: print(v)print('-...原创 2020-02-21 09:57:27 · 250 阅读 · 0 评论 -
2-p02_fac阶乘函数
def fac(n): result=1 for i in range(2,n+1): result*=i return resultclass BigInt: def __init__(self,value): self.digits=[value] def mul(self,n): addition=...原创 2020-02-21 09:59:07 · 513 阅读 · 0 评论 -
3-p03_monkey_peach五猴分桃
def get_peaches(monkeys): peaches=1 while not distribute(peaches,monkeys): peaches +=monkeys#每次加1太慢,可以每次加monkeys return peachesdef distribute(peaches,monkeys): for _ in rang...原创 2020-02-21 10:00:00 · 499 阅读 · 0 评论 -
4-p04_guess_name
import mathNAMES='赵钱孙李周吴郑王冯陈褚卫蒋武韩'def get_rows(): num=len(NAMES) rows=int(math.log2(num)+1) result=[''for _ in range(rows)] id =1 for name in NAMES: insert_name(id, nam...原创 2020-02-21 12:13:00 · 376 阅读 · 0 评论 -
5-p05_prisoners
import numpy as npdef prison(prisoners): monitor=prisoners - 1 #定义一个班长 switch=[False] * monitor#出去人数 lamp = False#开关 num=0 while True: luck=np.random.randint(0,prisoners...原创 2020-02-21 13:35:59 · 235 阅读 · 0 评论 -
6-p06_hanoi河内塔问题
def hanoi(panes,src,buffer,dst): if panes ==1: print('Move 1 from %s ==> %s' % (src,dst)) else: hanoi(panes-1,src,dst,buffer) print('Move %d from %s ==> %s' % (...原创 2020-02-23 12:26:44 · 222 阅读 · 0 评论 -
25-Mnist01
from tensorflow.examples.tutorials.mnist.input_data import read_data_setsimport numpy as npimport cv2SAMPLES_PATH = './MNIST_data'def temp_reshape_transpose(): x = np.random.randint(0, 10, ...原创 2020-07-27 11:07:04 · 124 阅读 · 1 评论 -
7-p07_rabbit
def get_rabbits(months): if months <2 : return 1 return get_rabbits(months-1)+get_rabbits(months-2)if __name__=='__main__': for month in range(1,10+1): print(month,'-...原创 2020-02-23 14:12:02 · 127 阅读 · 0 评论 -
8-p08_match
def match(s,p): if len(p)==0: return len(s)==0 first = p[0] if first=='?': return len(s) > 0 and match(s[1:],p[1:]) if first=='*': return match(s,p[1:]) or...原创 2020-02-23 14:29:07 · 192 阅读 · 0 评论 -
9-p09_comb组合数
def comb(m,n): if n==0 or m==n : return 1 return comb(m-1,n-1) + comb(m-1,n)if __name__ == '__main__':#先写主程序,再写子程序的子程序 for m in range(1,10+1): for n in range(0,m+1): ...原创 2020-02-23 14:46:08 · 235 阅读 · 0 评论 -
10-p10_perm排列
def perm(m,n): if n==0: return 1 result=n*perm(m-1,n-1) if m>n: result += perm(m-1,n) return resultif __name__ == '__main__':#先写主程序,再写子程序的子程序 for m in range(1...原创 2020-02-23 17:16:57 · 350 阅读 · 0 评论 -
11-p11_trains
def get_train(n,m=0):#n列车,m辆在里面等 if n==0 :#边界 return 1 result=get_train(n-1,m+1) if m>0: result += get_train(n,m-1)#m-1 return resultif __name__ == '__main__': ...原创 2020-02-23 17:17:44 · 139 阅读 · 0 评论 -
12-frac
class Frac: def __init__(self, div, der=1): g = gcd(div, der)# self.div = div // g self.der = der // g def __repr__(self): return '%d/%d' % (self.div, self.der...原创 2020-02-24 11:35:55 · 421 阅读 · 0 评论 -
13-p13_min一元函数最小值
def y(x): return (x-2.5) ** 2def y_deriv(x):#导数 return 2 * (x-2.5)def dx(x,alpha):#步长 return -y_deriv(x) * alphax=1.0#设定初值for _ in range(1000): x += dx(x,0.01)#学习率alphaprint...原创 2020-02-25 11:45:54 · 182 阅读 · 0 评论 -
13-2-p13_min2多元函数乘法
a = 2.5b = 1.4def y(x1, x2): return (x1 - a)**2 * (x2 - b)**2def dy_dx1(x1, x2): return 2*(x1-a) * (x2-b)**2def dy_dx2(x1, x2): return (x1-a)**2 * 2 * (x2-b)def dx1(x1, x2, a...原创 2020-02-25 11:46:49 · 190 阅读 · 0 评论 -
13-3-p13_min3多元函数加法
a = 2.5b = 1.4def y(x1, x2): return (x1 - a)**2 + (x2 - b)**2def dy_dx1(x1, x2): return 2*(x1-a)def dy_dx2(x1, x2): return 2 * (x2-b)def dx1(x1, x2, alpha): return -dy_dx...原创 2020-02-25 11:48:14 · 163 阅读 · 0 评论 -
14-p14_sqrt求平方根
def y(x, a): return (x**2 - a) ** 2def dy_dx(x, a): return 2 * (x**2 - a) * 2 * xdef dx(x, a, alpha): return - dy_dx(x, a) * alphaimport numpy as npx = np.random.uniform(0.1, 2)...原创 2020-02-25 22:19:21 · 221 阅读 · 0 评论 -
14-p14_sqrt2
import mathdef sqrt(a, epoches=4000, alpha=0.01): def y(x, a): return abs(x**2 - a) def dy_dx(x, a): dy = x**2 - a return 2 * x * (1 if dy > 0 else -1) def ...原创 2020-02-25 22:22:53 · 151 阅读 · 0 评论 -
15-p15_deriv导数
import mathimport numpy as npclass Exp: def eval(self, ** env): pass def deriv(self, x): pass def __add__(self, other): other = to_exp(other) return A...原创 2020-02-25 23:25:36 · 486 阅读 · 0 评论 -
p16_cuberroot立方根
import p15_deriv as derivdef train(y,x,epoches,learning_rate): dy_dx = y.deriv(x) x0=1.0 for _ in range(epoches): x0 += -dy_dx.eval(**{x.name:x0}) * learning_rate return x...原创 2020-02-26 13:00:29 · 345 阅读 · 0 评论 -
p17_tf_basic
import numpy as npimport tensorflow as tfa = np.array([1, 2, 3])print(a)print(a.shape)b = a + 3print(b)a = np.random.uniform(size=[2, 3, 4])b = np.random.uniform(size=[1, 4])print('-' * 2...原创 2020-02-26 20:48:25 · 220 阅读 · 0 评论 -
p18_tf_sqrt
import mathimport tensorflow as tfdef sqrt(a, lr=0.01, epoches=2000): g = tf.Graph() with g.as_default(): x = tf.get_variable('x', [], tf.float32) # x = 1.0 # y = (x**2 -...原创 2020-02-27 15:42:38 · 342 阅读 · 0 评论 -
19-p19_tf_sin_samples
import mathimport tensorflow as tfimport numpy as npfrom matplotlib import pyplotdef sqrt(a_value, b_value, lr=0.01, epoches=2000): g = tf.Graph() with g.as_default(): a = tf.pla...原创 2020-02-27 16:15:45 · 134 阅读 · 0 评论 -
21-p21_sin
import mathimport tensorflow as tfimport numpy as npfrom matplotlib import pyplotHIDDEN_UNITS = 200SAMPLES = 5def sqrt(a_value, b_value, lr=0.01, epoches=2000): g = tf.Graph() with g...原创 2020-02-27 17:59:12 · 125 阅读 · 0 评论 -
20-p20_tf.reshape
import tensorflow as tfimport numpy as npx = np.random.uniform(size=[2,3,4])y = np.reshape(x,[2,12])print(y.shape)y =np.reshape(x,[24])print(y.shape)#(24,)y = np.reshape(x,[2,1,3,4])print...原创 2020-02-27 18:01:00 · 168 阅读 · 0 评论 -
22-p22_sin_cos_sqr
import mathimport tensorflow as tfimport numpy as npfrom matplotlib import pyplotHIDDEN_UNITS = 200SAMPLES = 200def sqrt(a_value, b_value, lr=0.01, epoches=2000): g = tf.Graph() with...原创 2020-02-27 18:18:31 · 137 阅读 · 0 评论 -
23-p23_puke
def get_pukes(num): result = [num] for k in range(num - 1, 0, -1): for _ in range(k): result = reverse(result) result.insert(0, k) return resultdef reverse(p...原创 2020-02-28 10:55:44 · 197 阅读 · 0 评论 -
24-p24_binary_trees
def get_binary_trees(num): if num < 2: return 1 num -= 1 #root result = 0 for lefts in range(num+1): result += get_binary_trees(lefts) * get_binary_trees(num - left...原创 2020-02-28 11:47:50 · 122 阅读 · 0 评论 -
25-Mnist01
from tensorflow.examples.tutorials.mnist.input_data import read_data_setsimport numpy as npimport cv2SAMPLES_PATH = './MNIST_data'def temp_reshape_transpose(): x = np.random.randint(0, 10, ...原创 2020-03-02 12:54:19 · 145 阅读 · 0 评论