资源简介

人脸识别源码,自己写的,可以规则匹配。

资源截图

代码片段和文件信息

“““ Tensorflow implementation of the face detection / alignment algorithm found at
https://github.com/kpzhang93/MTCNN_face_detection_alignment
“““
# MIT License

# Copyright (c) 2016 David Sandberg

# Permission is hereby granted free of charge to any person obtaining a copy
# of this software and associated documentation files (the “Software“) to deal
# in the Software without restriction including without limitation the rights
# to use copy modify merge publish distribute sublicense and/or sell
# copies of the Software and to permit persons to whom the Software is
# furnished to do so subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
# IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from six import string_types iteritems

import numpy as np
import tensorflow as tf
#from math import floor
import cv2
import os

def layer(op):
    “““Decorator for composable network layers.“““

    def layer_decorated(self *args **kwargs):
        # Automatically set a name if not provided.
        name = kwargs.setdefault(‘name‘ self.get_unique_name(op.__name__))
        # Figure out the layer inputs.
        if len(self.terminals) == 0:
            raise RuntimeError(‘No input variables found for layer %s.‘ % name)
        elif len(self.terminals) == 1:
            layer_input = self.terminals[0]
        else:
            layer_input = list(self.terminals)
        # Perform the operation and get the output.
        layer_output = op(self layer_input *args **kwargs)
        # Add to layer LUT.
        self.layers[name] = layer_output
        # This output is now the input for the next layer.
        self.feed(layer_output)
        # Return self for chained calls.
        return self

    return layer_decorated

class Network(object):

    def __init__(self inputs trainable=True):
        # The input nodes for this network
        self.inputs = inputs
        # The current list of terminal nodes
        self.terminals = []
        # Mapping from layer names to layers
        self.layers = dict(inputs)
        # If true the resulting variables are set as trainable
        self.trainable = trainable

        self.setup()

    def setup(self):
        “““Construct the network. “““
        raise NotImplementedError(‘Must be implemented by the subclass.‘)

    def load(self data_path session i

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\
     文件        1061  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\LICENSE
     文件        1807  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\README.md
     目录           0  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\__pycache__\
     文件       22048  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\__pycache__\detect_face.cpython-36.pyc
     文件        6618  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\__pycache__\face.cpython-36.pyc
     文件       17952  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\__pycache__\facenet.cpython-36.pyc
     文件        6274  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\__pycache__\fhog.cpython-36.pyc
     文件       10383  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\__pycache__\kcftracker.cpython-36.pyc
     文件       27368  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\det1.npy
     文件      401681  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\det2.npy
     文件     1557360  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\det3.npy
     文件       31697  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\detect_face.py
     文件       27357  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\detect_face.pyc
     文件        8263  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\export_embeddings.py
     文件        8516  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\face.py
     文件        7618  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\face.pyc
     目录           0  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\face_lib\
     文件         592  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\face_lib\li.npy
     文件         592  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\face_lib\liu.npy
     文件         592  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\face_lib\wang.npy
     文件       22155  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\facenet.py
     文件       21586  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\facenet.pyc
     文件       12483  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\fhog.py
     文件        7355  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\fhog.pyc
     文件       11946  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\kcftracker.py
     文件       12721  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\kcftracker.pyc
     文件         592  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\li.npy
     文件         592  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\liu.npy
     文件        6164  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\predict.py
     文件        3713  2018-02-25 08:36  facebroadcast-demo-f88e91f73c3308993313d75bc2631920d0d16187\run.py
............此处省略2个文件信息

评论

共有 条评论