首先将数据集组织成
|--数据集名称
|--人脸ID_1
|--人脸ID_1的脸部图像.jpg
|--人脸ID_1的脸部图像.jpg
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<ScrollView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:scrollbars="vertical" | |
android:fadingEdge="vertical" |
package buaa.ldmc.hvt.videoabstract.Adapters; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Button; | |
import android.widget.ImageView; | |
import android.widget.SimpleAdapter; |
cl_rst = np.array(clustering.labels_) | |
print(frame_file) | |
fig = mayavi.mlab.figure(mlab.gcf(), bgcolor=(0, 0, 0), size=(640 * 2, 360 * 2)) | |
nodes = mayavi.mlab.points3d( | |
xx, yy, zz, | |
# clustering.labels_, | |
# mode="cube", | |
mode="cube", | |
# color=(0, 1, 0), |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib | |
from matplotlib.patches import Polygon | |
from matplotlib.collections import PatchCollection | |
fig, ax = plt.subplots() | |
patches = [] | |
num_polygons = 5 |
# 如果我们要生成一个等差递增的矩阵,而不仅仅是等差递增的向量 | |
# linescape仍然能满足我们的需求 | |
# 需要实现的是,从一个长度为L的连续的序列中随机选取BATCH_SIZE数量的,长度为l(较短)的若干短序列 | |
# 举个例子,想象我们有一篇文章,每一个词向量是一个元素,那么整个文章就构成了一个长度为L的词序列 | |
# 现在我们要实现的就是,从这篇文章重随机抽取一批短的词序列,比如抽取100条,长度为5的词序列 | |
# 我们要实现的就是这样的功能 | |
batch_size=512 | |
L=20000 | |
l=5 # 要取的长度 |
dir = '/media/f214/workspace/sky/logs/AUDIT/2019-04-12_16-12-42' | |
file_list = os.listdir(os.path.join(dir, 'output_log')) | |
# -4 denotes the length of file extension, ie, '.csv' is -4, '.mpeg' is-5. | |
file_list.sort(key=lambda f: int(f[:-4])) |
# dt是数值,可通过调整dt的数量级来实现不同阶数的运动方程 | |
# 比如匀加速运动, 其中X=X(n-1)+V(n-1)dt+a(n-1)dt^2 | |
# 这时可以在运动描述矩阵中,将dt设置为0.1,dt^2设置为0.01 |
首先将数据集组织成
|--数据集名称
|--人脸ID_1
|--人脸ID_1的脸部图像.jpg
|--人脸ID_1的脸部图像.jpg
import scipy | |
import scipy.io as scio | |
import numpy as np | |
import cv2 | |
import sklearn | |
from sklearn.decomposition import PCA | |
from sklearn.neighbors import KNeighborsClassifier | |
from sklearn import metrics | |
import matplotlib.pyplot as plt | |
import pickle as pkl |
import scipy | |
import scipy.io as scio | |
import numpy as np | |
import cv2 | |
import sklearn | |
from sklearn.decomposition import PCA | |
from sklearn.neighbors import KNeighborsClassifier | |
from sklearn import metrics | |
import matplotlib.pyplot as plt | |
import pickle as pkl |