Skip to content
Snippets Groups Projects
Commit 12d33735 authored by Richard Torenvliet's avatar Richard Torenvliet
Browse files

Made changes for production deployment

parent 91eabca7
No related branches found
No related tags found
No related merge requests found
...@@ -7,3 +7,4 @@ src/reconstruction/*.c ...@@ -7,3 +7,4 @@ src/reconstruction/*.c
src/reconstruction/build/ src/reconstruction/build/
*.dSYM *.dSYM
vendor/* vendor/*
*.pyc
TARGETS += data/pca_shape_train_model.npy
.PHONY := train_model show_pca test_model show_reconstruction .PHONY := train_model show_pca test_model show_reconstruction
DEBUG_LEVEL=* DEBUG_LEVEL=*
data/imm_face_db: data/imm_face_db.tar.gz data/imm_face_db: data/imm_face_db.tar.gz
(cd data; mkdir -p imm_face_db; \ (cd data; mkdir -p imm_face_db; \
tar -xvzf imm_face_db.tar.gz -C imm_face_db tar -xvzf imm_face_db.tar.gz -C imm_face_db \
) )
train_model: train_shape train_texture shape_predictor_68_face_landmarks.dat:
train_texture: data/pca_imm_texture_model.npy data/pca_ibug_texture_model.npy wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 -P data/
train_shape: data/pca_imm_shape_model.npy data/pca_ibug_shape_model.npy (cd data/; bzip2 -d shape_predictor_68_face_landmarks.dat.bz2)
data/imm_face_db.tar.gz: data/imm_face_db.tar.gz:
(cd data; wget http://www.imm.dtu.dk/~aam/datasets/imm_face_db.tar.gz) (cd data; wget http://www.imm.dtu.dk/~aam/datasets/imm_face_db.tar.gz)
...@@ -17,7 +16,8 @@ data/imm_face_db.tar.gz: ...@@ -17,7 +16,8 @@ data/imm_face_db.tar.gz:
runnit: runnit:
$(BASE_DOCKER_CMD) python main.py $(BASE_DOCKER_CMD) python main.py
compile_texture: src/reconstruction/texture.pyx
src/reconstruction/texture.so: src/reconstruction/texture.pyx
$(BASE_DOCKER_CMD) /bin/bash -c '(cd reconstruction; python setup.py build_ext --inplace)' $(BASE_DOCKER_CMD) /bin/bash -c '(cd reconstruction; python setup.py build_ext --inplace)'
data/pca_imm_shape_model.npy: data/pca_imm_shape_model.npy:
......
DEBUG:=1 DEBUG:=1
VERSION:=v0.1 VERSION:=v0.1
IMAGE_TAG:= icyrizard/face-reconstruction.git:$(VERSION) IMAGE_TAG:= icyrizard/face-reconstruction.git:$(VERSION)
BASE_DOCKER_CMD:= docker run \ HERE:=$(shell pwd)
--rm \ DOCKER_RUN_FLAGS:= --rm \
--volume /Users/richard/Documents/sighthub/face-reconstruction/data:/data \ --volume $(HERE)/data:/data \
--volume /Users/richard/Documents/sighthub/face-reconstruction/src:/src \ --volume $(HERE)/src:/src \
-e "DEBUG=$(DEBUG)" \ -e "DEBUG=$(DEBUG)" \
-p 8888:8888 \ -p 6930:8888
$(IMAGE_TAG)
include actions.mk BASE_DOCKER_CMD:= docker run $(DOCKER_RUN_FLAGS) $(IMAGE_TAG)
include src/reconstruction/build.mk
$(info $(TARGETS))
all: $(TARGETS) DEPENDENCIES:= data/imm_face_db
TARGETS:= shape_predictor_68_face_landmarks.dat\
src/reconstruction/texture.so \
data/pca_ibug_shape_model.npy \
data/pca_ibug_texture_model.npy
data: data/imm_face_db all: $(DEPENDENCIES) $(TARGETS)
reconstruction: texture.so
include actions.mk
include src/reconstruction/build.mk
OS := $(shell uname) OS := $(shell uname)
...@@ -23,7 +29,7 @@ build: requirements.txt ...@@ -23,7 +29,7 @@ build: requirements.txt
docker build -t $(IMAGE_TAG) . docker build -t $(IMAGE_TAG) .
run-bash: run-bash:
$(BASE_DOCKER_CMD) --interactive --tty $(IMAGE_TAG) /bin/bash docker run --interactive --tty $(DOCKER_RUN_FLAGS) $(IMAGE_TAG) /bin/bash
$(VIRTUALENV): $(VIRTUALENV):
virtualenv -p $(PYTHON_BIN_PATH) venv virtualenv -p $(PYTHON_BIN_PATH) venv
......
HERE := $(shell pwd) HERE := $(shell pwd)
TARGETS += src/reconstruction/texture.so
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
HALIDE_LINK:=https://github.com/halide/Halide/releases/download/release_2016_04_27/halide-mac-64-trunk-2f11b9fce62f596e832907b82d87e8f75c53dd07.tgz HALIDE_LINK:=https://github.com/halide/Halide/releases/download/release_2016_04_27/halide-mac-64-trunk-2f11b9fce62f596e832907b82d87e8f75c53dd07.tgz
......
...@@ -194,7 +194,7 @@ app = web.Application([ ...@@ -194,7 +194,7 @@ app = web.Application([
if __name__ == '__main__': if __name__ == '__main__':
app.listen(8888) app.listen(8888, xheaders=True)
ioloop = ioloop.IOLoop.instance() ioloop = ioloop.IOLoop.instance()
autoreload.start(ioloop) autoreload.start(ioloop)
ioloop.start() ioloop.start()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment