-
大小: 5KB文件类型: .m金币: 1下载: 0 次发布日期: 2021-06-03
- 语言: Matlab
- 标签:
资源简介
这个m文件需要添加相应的图片数据集,只要数据集足够大,可以实现对任一物体的识别。
代码片段和文件信息
clear all;
isReSplitSamples = 0;
numTrainSam = 20;
numTestSam = 0;
nRounds = 10;
fvFeaturesFlag = 3; %1-just use only one gmmComponent for all feature maps.
%0-use one gmmComponent for each features map that is the length of gmmComp will be 512 in our experiment
%2-regard N(ie.512) feature maps as N dinmension of a patch which is slide in result matrix.
%3-regard N(ie.512) feature maps as N dimension of a patch which is slide in result matrix.
%In each patch connect each pixel‘s Ndimension features that for one patch it has N * patchW * patchH dimension feature
fvNormFlag = 1; %1-do normalization in fv 0 - do not
nGMM = 64;
fvSlideWindow.sizePatch = 3;
fvSlideWindow.step = 1;
rationSamGMM = 1;
modelName = ‘imagenet-vgg-m‘;
layerSelected = ‘conv5‘;
dataSet = [modelName‘__‘layerSelected];
%for numTrainSam = [510204080]
resultDir = [‘..\result\‘dataSet‘\resultRecord\‘];
samSplitPath = [‘..\result\‘dataSet‘\sampleSplitted-‘num2str(numTrainSam)‘tr\‘];
if ~isdir(resultDir)
mkdir(resultDir);
end
if ~isdir(samSplitPath)
mkdir(samSplitPath);
end
dDataSelectedPrePorcForExpPath = ‘..\dataPrePorcess\‘;
dDataSelectedPrePorcForExpPath = [dDataSelectedPrePorcForExpPathmodelName‘__‘layerSelected‘\‘];
libVlfeatPath = ‘..\tool\VLFEAT\vlfeat-0.9.19\toolbox\‘;
liblinearPath = ‘..\tool\liblinear\matlab\‘;
libsvmPath = ‘..\tool\libsvm\matlab\‘;
addpath(liblinearPath);
addpath(libsvmPath);
addpath(libVlfeatPath);
vl_setup;
load([dDataSelectedPrePorcForExpPath‘samples.mat‘]‘samplesAll‘‘samplesAllLabel‘);
samplesAllLabel = samplesAllLabel‘;
accuracyAll = zeros(nRounds 1);
%predLabelAll = cell(nRounds 1);
%gndLabelAll = cell(nRounds 1);
for ii = 1:nRounds
disp([‘***** Round ‘num2str(ii)‘ :‘]);
if isReSplitSamples
disp(‘***** Splitting the samples to training samples and testing samples...‘);
[samplesTrainsamplesTestsamplesTrainIndexInAllsamplesTestIndexInAll] = funSplitSamNew(samplesAllsamplesAllLabelnumTrainSamnumTestSam);
save([samSplitPath‘round_‘num2str(ii)‘_Splitted.mat‘]‘samplesTrain‘‘samplesTest‘‘samplesTrainIndexInAll‘‘samplesTestIndexInAll‘);
else
disp(‘***** Loading the training samples and testing samples preslplitted already...‘);
load([samSplitPath‘round_‘num2str(ii)‘_Splitted.mat‘]‘samplesTrain‘‘samplesTest‘‘samplesTrainIndexInAll‘‘samplesTestInd
相关资源
- 使用matlab实现ICP点云匹配
- 计算机视觉极线校正
- matlab中关于三维重建的源代码,《计
- 东南大学计算机视觉实验报告二图像
- 三维重建sfm
- 区域增长(Region Growing)算法Matlab代码
- 光场深度估计MATLAB源代码
- 基于计算机视觉的图像分割算法的研
- 运动目标检测算法Matlab
- MATLAB计算机视觉与深度学习实战 完整
- 《数字图像处理-刚萨雷斯》图片素材
- Pearson-Digital Image Processing, 4th.Editio
- 回归学习算法
- 计算机视觉、图像处理、硬币识别
- matlab开发-RungeKuttaNystrom
- 区域增长(Region Growing)算法Matlab代码
- 四元数法计算两个物体之间的相对位
- Fusiello极线校正 - 论文和Matlab程序
- MATLAB联合双边滤波代码.zip
- GMM 本代码建立高斯混合模型(高斯多
- matlab开发-FastFFTFunction
- matlab开发-块正交匹配跟踪
- k-means聚类学习算法matlab源码
- NMF 非负矩阵分解 图像重构
评论
共有 条评论