-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.m
More file actions
executable file
·37 lines (26 loc) · 1.23 KB
/
main.m
File metadata and controls
executable file
·37 lines (26 loc) · 1.23 KB
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
34
35
36
37
%% Face replacement!
clc;
clear all;
%% To replace faces, call face_replace(img1, img2, video, single_ref)
% ============ Parameters ============
% % img1 = The input image whose faces have to be replaced by img2
% % img2 = The reference image wwhich contains the replacing face
% % video = Boolean parameter to set if img1 is image | video
% % single_ref = Boolean parameter to set if single reference image (img2) or reference face library
% ============ Examples ============
%% Replace all the 'Blend' images by face_library
face_replace('b', 'ref_images', 0, 0);
%% Replace all the 'Pose' images by face_library
face_replace('p', 'ref_images', 0, 0);
%% Replace all the 'More' images by a single image, say 'b3.jpg'
face_replace('m', 'b3.jpg', 0, 1);
%% Replace single 'b3.jpg' by a single image, say 'b5.jpg'
face_replace('b3.jpg', 'b5.jpg', 0, 1);
%% Replace video 'videoclip.avi' by the face_library
% The video is saved as 'result.avi'
face_replace('videoclip.avi', 'ref_images', 1, 0);
% face_replace('sherlock_10fps.avi', 'ref_images', 1, 0);
%% Runs replacement on the official test set and saves results in ./TestSet
face_replace('b', 'ref_images', 0, 0);
face_replace('p', 'ref_images', 0, 0);
face_replace('m', 'ref_images', 0, 0);