-
Notifications
You must be signed in to change notification settings - Fork 72
/
demo_fcn.m
33 lines (26 loc) · 818 Bytes
/
demo_fcn.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
% demo_fcn()
%
% Trains and tests a Fully Convolutional Network on SIFT Flow.
%
% Copyright by Holger Caesar, 2016
% Add folders to path
setup();
% Settings
expNameAppend = 'testRelease';
% Download dataset
downloadSiftFlow();
% Download base network
downloadNetwork();
% Train network
dataset = SiftFlowDatasetMC();
fcnTrainGeneric('expNameAppend', expNameAppend, 'dataset', dataset);
% Test network
stats = fcnTestGeneric('expNameAppend', expNameAppend, 'dataset', dataset);
disp(stats);
% Show example segmentation
global glFeaturesFolder;
labelingsFolder = fullfile(glFeaturesFolder, 'CNN-Models', 'FCN', dataset.name, sprintf('fcn16s-%s', expNameAppend), 'labelings-test-epoch50');
fileList = dirSubfolders(labelingsFolder);
image = imread(fullfile(labelingsFolder, fileList{1}));
figure();
imshow(image);