Demo script for showing how to use and verifying output aligned image sizes.
This commit is contained in:
parent
a224c10775
commit
39c206e44d
2 changed files with 28 additions and 20 deletions
|
@ -161,7 +161,7 @@ RecorderOpenFace::RecorderOpenFace(const std::string in_filename, RecorderOpenFa
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->media_filename = (path(record_root) / path(filename).replace_extension(".bmp")).string();
|
this->media_filename = (path(record_root) / path(filename).replace_extension(".jpg")).string();
|
||||||
metadata_file << "Output image:" << this->media_filename << endl;
|
metadata_file << "Output image:" << this->media_filename << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
% A demo script that demonstrates how to process a single video file using
|
% A demo script that demonstrates how to extract aligned faces from a sequence,
|
||||||
% OpenFace and extract and visualize all of the features
|
% also shows how to extract different sized aligned faces
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
||||||
|
@ -18,22 +18,30 @@ output_dir = './processed_features/';
|
||||||
|
|
||||||
img_sizes = [64, 112, 224];
|
img_sizes = [64, 112, 224];
|
||||||
|
|
||||||
% This will take file after -f and output all the features to directory
|
for s=1:numel(img_sizes)
|
||||||
% after -out_dir
|
% This will take file after -f and output all the features to directory
|
||||||
command = sprintf('%s -f "%s" -out_dir "%s" -verbose -simalign', executable, in_file, output_dir);
|
% after -out_dir, with name after -of
|
||||||
|
command = sprintf('%s -f "%s" -out_dir "%s" -simalign -simsize %d -of sample_%d', executable, in_file, output_dir, img_sizes(s), img_sizes(s) );
|
||||||
|
|
||||||
if(isunix)
|
if(isunix)
|
||||||
unix(command);
|
unix(command);
|
||||||
else
|
else
|
||||||
dos(command);
|
dos(command);
|
||||||
end
|
end
|
||||||
|
|
||||||
%% Output aligned images
|
%% Output aligned images
|
||||||
output_aligned_dir = sprintf('%s/%s_aligned/', output_dir, name);
|
output_aligned_dir = sprintf('%s/sample_%d_aligned/', output_dir, img_sizes(s));
|
||||||
img_files = dir([output_aligned_dir, '/*.bmp']);
|
img_files = dir([output_aligned_dir, '/*.bmp']);
|
||||||
imgs = cell(numel(img_files, 1));
|
imgs = cell(numel(img_files), 1);
|
||||||
for i=1:numel(img_files)
|
|
||||||
|
assert(numel(imgs) > 0);
|
||||||
|
|
||||||
|
for i=1:numel(img_files)
|
||||||
imgs{i} = imread([ output_aligned_dir, '/', img_files(i).name]);
|
imgs{i} = imread([ output_aligned_dir, '/', img_files(i).name]);
|
||||||
|
|
||||||
|
assert(size(imgs{i},1) == img_sizes(s) && size(imgs{i},2) == img_sizes(s));
|
||||||
|
|
||||||
imshow(imgs{i})
|
imshow(imgs{i})
|
||||||
drawnow
|
drawnow
|
||||||
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue