Skip to content

Commit

Permalink
Merge pull request #25 from Kautenja/TF2
Browse files Browse the repository at this point in the history
Update to TensorFlow 2.4.1
  • Loading branch information
Kautenja authored Apr 3, 2021
2 parents f9ae67e + 5b13b2e commit b3d897d
Show file tree
Hide file tree
Showing 91 changed files with 2,112 additions and 2,590 deletions.
12 changes: 0 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@
# Project files
#
build/
tex/*.pdf
tex/*.aux
tex/*.nav
tex/*.log
tex/*.out
tex/*.snm
tex/*.toc
tex/*.bbl
tex/*.blg
tex/*.brf
tex/*.swp
tex/*.nlo

#
# MacOS
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Christian Kauten
Copyright (c) 2021 Christian Kauten

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
96 changes: 59 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 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

all: style_transfer_videos layer_videos reconstruction_videos optimizer_videos tv_loss_videos photo_realistic_style_transfer_videos

# install Python dependencies in the requirements.txt
install:
${PYTHON} -m pip install -r requirements.txt
Expand All @@ -15,11 +15,6 @@ install:
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:
Expand All @@ -28,33 +23,60 @@ 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
style_transfer_videos: build
$(call frames_to_video,style-transfer/seated-nude)
$(call frames_to_video,style-transfer/the-starry-night)
$(call frames_to_video,style-transfer/the-scream)
$(call frames_to_video,style-transfer/the-shipwreck-of-the-minotaur)
$(call frames_to_video,style-transfer/composition-vii)
$(call frames_to_video,style-transfer/houses-of-parliament)

content_layer_videos: build
$(call frames_to_video,content-layer/block1_conv1)
$(call frames_to_video,content-layer/block2_conv1)
$(call frames_to_video,content-layer/block3_conv1)
$(call frames_to_video,content-layer/block4_conv1)
$(call frames_to_video,content-layer/block5_conv1)

style_layer_videos: build
$(call frames_to_video,style-layer/block1_conv1)
$(call frames_to_video,style-layer/block2_conv1)
$(call frames_to_video,style-layer/block3_conv1)
$(call frames_to_video,style-layer/block4_conv1)
$(call frames_to_video,style-layer/block5_conv1)

layer_videos: content_layer_videos style_layer_videos

content_reconstruction_videos: build
$(call frames_to_video,content-reconstruction/block1_conv1)
$(call frames_to_video,content-reconstruction/block2_conv1)
$(call frames_to_video,content-reconstruction/block3_conv1)
$(call frames_to_video,content-reconstruction/block4_conv1)
$(call frames_to_video,content-reconstruction/block4_conv2)
$(call frames_to_video,content-reconstruction/block5_conv1)

style_reconstruction_videos: build
$(call frames_to_video,style-reconstruction/block1_conv1)
$(call frames_to_video,style-reconstruction/block2_conv1)
$(call frames_to_video,style-reconstruction/block3_conv1)
$(call frames_to_video,style-reconstruction/block4_conv1)
$(call frames_to_video,style-reconstruction/block5_conv1)

reconstruction_videos: content_reconstruction_videos style_reconstruction_videos

optimizer_videos: build
$(call frames_to_video,optimizers/Adam)
$(call frames_to_video,optimizers/GradientDescent)
$(call frames_to_video,optimizers/L_BFGS)

tv_loss_videos: build
$(call frames_to_video,tv/0)
$(call frames_to_video,tv/1)
$(call frames_to_video,tv/10)
$(call frames_to_video,tv/100)
$(call frames_to_video,tv/1000)

photo_realistic_style_transfer_videos: build
$(call frames_to_video,photo-realistic-style-transfer/Adam)
$(call frames_to_video,photo-realistic-style-transfer/GradientDescent)
$(call frames_to_video,photo-realistic-style-transfer/L_BFGS)
Loading

0 comments on commit b3d897d

Please sign in to comment.