FFT 部分
- 无法import cv2,conda已经安装过opencv
解决方法:在所有import之前添加
import sys
sys.path.append('C:\Users\mb845111\Anaconda2\Lib\site-packages')
-
resize 缩小图片至特定尺寸
What is OpenCV’s INTER_AREA Actually Doing?inv_scale_x
和inv_scale_y
都能达到cv2.resize(img_man, (224, 224))
的效果。在缩小的时候会用到INTER_AREA
,resize function还提供INTER_NEAREST
,INTER_LINEAR
,INTER_AREA
,INTER_CUBIC
, andINTER_LANCZOS4
-
生成mask
uint8 Unsigned integer (0 to 255)型
rows, cols = img_man.shape
mask = np.ones(img_man.shape, np.uint8)
mask[int(rows / 2 - 30):int(rows / 2 + 30), int(cols / 2 - 30):int(cols / 2 + 30)] = 0
# 定义的mask是中间60*60的像素为0其余为1
- 将标签和像素点保存到list
Tensorflow高效讀取數據
为什么要打标签
Vgg部分
sklearn 中sklearn.metrics
模块实现了一些loss, score以及一些工具函数来计算分类性能。一些metrics可能需要正例、置信度、或二分决策值的的概率估计。
大多数实现允许每个sample提供一个对整体score来说带权重的分布,通过sample_weight
参数完成。
这位博主写的很棒,包括了二分类,多分类模型分类sklearn中的模型评估很实用,precision_score
, recall_score
,f1_score
详见3.8,roc_auc_score
详见3.12,accuracy_score
详见3.2。
SVM部分
数据
keras读取后缀名为.h5的文件 keras提供了get_weight
的函数
网友评论