-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30e975b
commit 29a754a
Showing
12 changed files
with
130 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM python:3.7-buster | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
libsm6 \ | ||
libxext6 \ | ||
libxrender1 | ||
|
||
RUN pip install gdown | ||
RUN gdown -O /tmp/my_model_colorization.h5 'https://drive.google.com/uc?id=12hyrk6A3bcpAFIBNW0sfeEevJ9daUTGr' | ||
|
||
RUN pip install \ | ||
opencv-python==4.1.0.25 \ | ||
numpy==1.15.4 \ | ||
tensorflow==1.13.1 \ | ||
keras==2.2.4 \ | ||
h5py==2.10.0 | ||
|
||
RUN mkdir -p /code/MODEL/imagenet && mv /tmp/my_model_colorization.h5 /code/MODEL/imagenet/modelPretrained.h5 | ||
|
||
# pre-cache vgg16 | ||
RUN python -c "from keras import applications; applications.vgg16.VGG16(weights='imagenet', include_top=True)" | ||
|
||
COPY . /code | ||
WORKDIR /code/SOURCE | ||
RUN sed -i "s/BATCH_SIZE = 10/BATCH_SIZE = 1/" config.py | ||
|
||
ENTRYPOINT ["python", "ChromaGANPrint.py", "--no-concatenate"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y software-properties-common && \ | ||
add-apt-repository ppa:deadsnakes/ppa && \ | ||
apt-get update && \ | ||
apt-get install -y \ | ||
libsm6 \ | ||
libxext6 \ | ||
libxrender1 \ | ||
python3.7 \ | ||
python3-pip | ||
|
||
RUN pip3 install gdown | ||
RUN gdown -O /tmp/my_model_colorization.h5 'https://drive.google.com/uc?id=12hyrk6A3bcpAFIBNW0sfeEevJ9daUTGr' | ||
|
||
RUN pip3 install \ | ||
opencv-python==4.1.0.25 \ | ||
numpy==1.15.4 \ | ||
tensorflow-gpu==1.13.1 \ | ||
keras==2.2.4 \ | ||
h5py==2.10.0 | ||
|
||
RUN mkdir -p /code/MODEL/imagenet && mv /tmp/my_model_colorization.h5 /code/MODEL/imagenet/modelPretrained.h5 | ||
|
||
# pre-cache vgg16 | ||
RUN python3 -c "from keras import applications; applications.vgg16.VGG16(weights='imagenet', include_top=True)" | ||
|
||
COPY . /code | ||
WORKDIR /code/SOURCE | ||
RUN sed -i "s/BATCH_SIZE = 10/BATCH_SIZE = 1/" config.py | ||
|
||
ENTRYPOINT ["python3", "ChromaGANPrint.py", "--no-concatenate"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash -eux | ||
|
||
# Run this script from the repo's root folder | ||
# | ||
# $ ./docker/build-and-push.sh | ||
|
||
# 1. Build Docker images for CPU and GPU | ||
|
||
image="us-docker.pkg.dev/replicate/pvitoria/chromagan" | ||
cpu_tag="$image:cpu" | ||
gpu_tag="$image:gpu" | ||
docker build -f docker/Dockerfile.cpu --tag "$cpu_tag" . | ||
docker build -f docker/Dockerfile.gpu --tag "$gpu_tag" . | ||
|
||
# 2. Test Docker images | ||
|
||
test_input_folder=/tmp/test-chromagan/input | ||
mkdir -p $test_input_folder | ||
cp SAMPLE_IMGS/grayscale/bruschetta.png $test_input_folder/ | ||
test_output_folder=/tmp/test-chromagan/output | ||
|
||
docker run -it \ | ||
-v $test_input_folder:/code/DATASET/imagenet/test \ | ||
-v $test_output_folder/cpu:/code/RESULT/imagenet \ | ||
$cpu_tag | ||
|
||
[ -f $test_output_folder/cpu/*_bruschettapsnr_reconstructed.jpg ] || exit 1 | ||
|
||
docker run -it \ | ||
-v $test_input_folder:/code/DATASET/imagenet/test \ | ||
-v $test_output_folder/gpu:/code/RESULT/imagenet \ | ||
$gpu_tag | ||
|
||
[ -f $test_output_folder/gpu/*_bruschettapsnr_reconstructed.jpg ] || exit 1 | ||
|
||
sudo rm -rf "$test_input_folder" | ||
sudo rm -rf "$test_output_folder" | ||
|
||
# 3. Push the Docker images | ||
|
||
docker push $cpu_tag | ||
docker push $gpu_tag |