forked from Kautenja/a-neural-algorithm-of-artistic-style
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·60 lines (52 loc) · 2.12 KB
/
Makefile
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# the executable for Python
PYTHON=python3
# the directory the main framework exists in
MAIN=neural_stylization
# the build directory
BUILD=build
# the number of frames of interpolation to use in videos
INTER_FRAMES=3
# install Python dependencies in the requirements.txt
install:
${PYTHON} -m pip install -r requirements.txt
# make a build directory
build:
mkdir -p ${BUILD}
# delete all the stupid garbage that LaTeX generates. Run this before and
# after to ensure that each build is completely fresh.
delete_tex_garbage:
cd tex && rm -f *.aux *.nav *.log *.out *.snm *.toc *.bbl *.blg *.brf *.swp *.nlo
# Convert the frames in a given directory to a video of the directories name
# in its parent directory.
# Args:
# 1: the name of the directory in the build directory to find frames in
define frames_to_video
${PYTHON} frames_to_video.py build/$(1) build/$(1).mp4 ${INTER_FRAMES}
endef
# make all the content reconstruction videos
content_videos: build
$(call frames_to_video,content/block1_conv1)
$(call frames_to_video,content/block2_conv1)
$(call frames_to_video,content/block3_conv1)
$(call frames_to_video,content/block4_conv1)
$(call frames_to_video,content/block5_conv1)
$(call frames_to_video,content/block4_conv2)
# make all the style reconstruction videos
style_videos: build
$(call frames_to_video,style/block1_conv1)
$(call frames_to_video,style/block2_conv1)
$(call frames_to_video,style/block3_conv1)
$(call frames_to_video,style/block4_conv1)
$(call frames_to_video,style/block5_conv1)
# make all the style transfer videos
transfer_videos: build
$(call frames_to_video,transfer/seated-nude)
$(call frames_to_video,transfer/the-starry-night)
$(call frames_to_video,transfer/the-scream)
$(call frames_to_video,transfer/the-shipwreck-of-the-minotaur)
$(call frames_to_video,transfer/composition-vii)
$(call frames_to_video,transfer/houses-of-parliament/tv-0)
$(call frames_to_video,transfer/houses-of-parliament/tv-1e0)
$(call frames_to_video,transfer/houses-of-parliament/tv-1e1)
# make all the built videos
videos: content_videos style_videos transfer_videos