资源简介
博客中的人脸聚类源码,安装完相应python库后可运行,请新建dataset用于存放原始图片 encode_file用于存放人脸特征文件

代码片段和文件信息
from sklearn.cluster import DBSCAN
from imutils import build_montages
import numpy as np
import argparse
import pickle
import cv2
from sklearn.metrics import silhouette_score calinski_harabasz_score davies_bouldin_score # 计算 轮廓系数,CH 指标,DBI
from sklearn.datasets import load_breast_cancer
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
from mpl_toolkits.mplot3d import Axes3D
class oreration_encodefile():
def __init__(self):
pass
def do_add_imgages_in_encodefile(selfsource_imagefile_path):
‘‘‘保留‘‘‘
pass
def do_add_encodefile_in_encodefile(selfsource_encodefile_pathobj_encodefile_path):
all_encodings = []
all_imagepath = []
for eachfile in source_encodefile_path:
data = pickle.loads(open(eachfile “rb“).read())
data = np.array(data)
encodings = [d[“encoding“] for d in data]
imagespath = [d[‘imagePath‘] for d in data]
all_encodings.extend(encodings)
all_imagepath.extend(imagespath)
d = [{“imagePath“: imgpath “encoding“: enc}
for imgpathenc in zip(all_imagepathall_encodings)]
with open(obj_encodefile_path ‘wb‘) as fp:
fp.write(pickle.dumps(d))
# data_all = pickle.loads(open(source_encodefile_path “rb“).read())
# data_temp = pickle.loads(open(obj_encodefile_path “rb“).read())
# data_all = np.array(data_all)
# data_temp = np.array(data_temp)
# encodings = [d[“encoding“] for d in data_all]
# imagespath = [d[‘imagePath‘] for d in data_all]
# encoding_temp = [d[“encoding“] for d in data_temp]
# imagespath_temp = [d[‘imagePath‘] for d in data_temp]
# encodings.extend(encoding_temp)
# imagespath.extend(imagespath_temp)
pass
if __name__ == ‘__main__‘:
inputfile_path_source = [‘./encode_file/addtest1_hog[2020_02_28-11_31_59].pickle‘‘./encode_file/addtest1_hog[2020_02_28-11_33_58].pickle‘]
inputfile_path_obj = ‘./encode_file/me.pickle‘
O = oreration_encodefile()
O.do_add_encodefile_in_encodefile(inputfile_path_sourceinputfile_path_obj)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-03-16 17:37 FaceClustering\
目录 0 2020-03-05 09:55 FaceClustering\.idea\
文件 586 2020-03-05 09:54 FaceClustering\.idea\face-clustering.iml
目录 0 2020-03-02 11:03 FaceClustering\.idea\inspectionProfiles\
文件 174 2020-02-23 17:42 FaceClustering\.idea\inspectionProfiles\profiles_settings.xm
文件 206 2020-03-02 16:18 FaceClustering\.idea\misc.xm
文件 289 2020-02-23 17:42 FaceClustering\.idea\modules.xm
文件 5988 2020-03-05 09:55 FaceClustering\.idea\workspace.xm
目录 0 2020-03-05 12:51 FaceClustering\__pycache__\
文件 7538 2020-03-05 12:51 FaceClustering\__pycache__\class_cluster.cpython-36.pyc
文件 2612 2020-03-05 12:51 FaceClustering\__pycache__\class_encode.cpython-36.pyc
文件 2283 2020-02-28 11:41 FaceClustering\add_encode_file.py
文件 1238 2020-02-27 11:30 FaceClustering\check_img_size.py
文件 10963 2020-03-04 16:52 FaceClustering\class_cluster.py
文件 3910 2020-03-03 16:55 FaceClustering\class_encode.py
文件 3888 2020-02-26 16:41 FaceClustering\cluster_faces.py
文件 2265 2020-02-26 10:05 FaceClustering\data_visualization.py
文件 2813 2020-02-26 11:04 FaceClustering\encode_faces.py
文件 377 2020-02-24 09:42 FaceClustering\myfunc.py
文件 3610 2020-02-24 12:00 FaceClustering\space.jpg
文件 2961 2020-02-24 16:21 FaceClustering\temp.py
文件 1062 2020-02-28 11:16 FaceClustering\testfile.py
相关资源
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
- 量化交易(附python常见函数的使用方
评论
共有 条评论