资源简介
VGG16实现人脸检测
代码片段和文件信息
# coding: utf-8
import os
import tensorflow as tf
import numpy as np
# new params
num_classes = 2
VGG_MEAN = [103.062623801 115.902882574 123.151630838]
def load_graph():
with tf.device(‘/cpu:0‘):
g = tf.Graph()
with g.as_default():
x = tf.placeholder(tf.float32 shape=[1 112 112 3] name=‘x‘)
prob = Net(x)
return g x prob
def _get_variable(name shape initializer dtype=‘float‘ trainable=True):
return tf.get_variable(name shape=shape initializer=initializer trainable=trainable dtype=dtype)
# 定义卷积 conv
def conv_layer(input
num_input_features
num_out_features
filter_size
stride
padding=‘SAME‘
name=None
dtype=‘float‘
trainable=True):
with tf.variable_scope(name):
# weights shape
shape_weights = [filter_size filter_size num_input_features num_out_features]
shape_biases = [num_out_features]
initilizer_weights = tf.truncated_normal_initializer(stddev=0.02)
initilizer_biases = tf.truncated_normal_initializer(stddev=0.02)
weights = _get_variable(‘weights‘
shape=shape_weights
initializer=initilizer_weights
trainable=True)
biases = _get_variable(‘biases‘
shape=shape_biases
initializer=initilizer_biases
trainable=True)
conv = tf.nn.conv2d(input weights strides=[1 stride stride 1] padding=padding)
return tf.nn.bias_add(conv biases)
# 定义非线性激励函数,relu
def action(input):
return tf.nn.relu(input)
# 定义max pooling
def max_pool(input ksize stride pading name):
return tf.nn.max_pool(input
ksize=[1 ksize ksize 1]
strides=[1 stride stride 1]
padding=pading
name=name)
# 展平
def flatten_layer(layer):
layer_shape = layer.get_shape()
# get input features
num_input_features = layer_shape[1:4].num_elements()
layer_flat = tf.reshape(layer [-1 num_input_features])
return layer_flat num_input_features
# 定义全连接 FC层
def fc_layer(input num_output_features name):
with tf.variable_scope(name):
layer_flat num_input_features = flatten_layer(input)
shape_fc_weights = [num_input_features num_output_features]
shape_fc_biases = [num_output_features]
initilizer_fc_weights = tf.truncated_normal_initializer(stddev=0.02)
initilizer_fc_biases = tf.truncated_normal_initializer(stddev=0.02)
fc_weights = _get_variable(‘weights‘ shape=shape_fc_weights initializer=initilizer_fc_weights trainable=True)
f
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 0 2020-09-25 07:11 vgg16瀹炵幇浜鸿劯妫€娴?
文件 9201 2019-05-13 09:52 vgg16瀹炵幇浜鸿劯妫€娴?Vgg16.py
文件 276 2019-05-13 09:52 __MACOSX\vgg16瀹炵幇浜鸿劯妫€娴?._Vgg16.py
- 上一篇:用python画第一型空间曲线
- 下一篇:python 画熊猫(基于turtle)
相关资源
- 计算机视觉 opencv 检测不合格产品.
- 基于K210开发的人脸特征识别2020电赛(
- 图片分类,图像识别,目标检测
- 人脸检测和识别(opencv3+python)
- python检测图片是否有人脸
- 以树莓派为基础,连接有毒气体传感
- tensorflow2.0 yolo3目标检测算法
- Python-直播答题助手自动检测出题搜索
- Python-本项目基于yolo3与crnn实现中文自
- python火焰检测颜色模型代码
- miller_rabin检测生成大素数的RSA算法实
- python3.5 百度ai人脸识别
- python基于人脸检测和人脸识别
- Python-一系列高品质的动漫人脸数据集
- Python-Insightface人脸检测识别的最小化
- Python-自然场景文本检测PSENet的一个
- Python-基于YOLOv3的行人检测
- Python-高效准确的EAST文本检测器的一个
- Python-pytorch实现的人脸检测和人脸识别
- Python-机器学习驱动的Web应用程序防火
- Python-神经网络模型能够从音频演讲中
- dlib-19.18.0-cp37-cp37m-linux_armv7l.whl
- 人脸识别算法,双2D2DPCALBP余弦相似度
- MATLAB版本的2Dpca和欧式距离算法
- Python-PCA降维人脸识别,已包含yale数据
- 人脸识别算法 python
- dlib18.17 编译好的python-dlib库 不需要
- python人脸识别截取
- 性别模型库 simple_CNN.81-0.96.hdf5
- 人脸识别图片集(刘德华吴彦祖)
评论
共有 条评论