Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Commit 03914db

Browse files
committed
Fix formatting, minor tweaks to Docker build files for release.
1 parent 448e7b9 commit 03914db

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

docker-cpu.df

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ RUN /opt/conda/bin/python3.5 -m pip install -q -r "requirements.txt"
2626
COPY enhance.py .
2727

2828
# Get a pre-trained neural networks, non-commercial & attribution.
29-
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-small-0.1.pkl.bz2"
30-
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-medium-0.1.pkl.bz2"
31-
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-large-0.1.pkl.bz2"
29+
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne1x-small-0.2.pkl.bz2"
30+
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne2x-small-0.2.pkl.bz2"
3231

3332
# Set an entrypoint to the main enhance.py script
3433
ENTRYPOINT ["/opt/conda/bin/python3.5", "enhance.py", "--device=cpu"]

docker-gpu.df

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ RUN /opt/conda/bin/python3.5 -m pip install -q -r "requirements.txt"
2424
COPY enhance.py .
2525

2626
# Get a pre-trained neural networks, non-commercial & attribution.
27-
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-small-0.1.pkl.bz2"
28-
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-medium-0.1.pkl.bz2"
29-
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-large-0.1.pkl.bz2"
27+
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne1x-small-0.2.pkl.bz2"
28+
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne2x-small-0.2.pkl.bz2"
3029

3130
# Set an entrypoint to the main enhance.py script
3231
ENTRYPOINT ["/opt/conda/bin/python3.5", "enhance.py", "--device=gpu"]

enhance.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ def add_to_buffer(self, f):
180180
seed = PIL.Image.open(buffer)
181181

182182
seed = scipy.misc.fromimage(seed, mode='RGB').astype(np.float32)
183-
seed += scipy.random.normal(scale=args.train_noise, size=(seed.shape[0], seed.shape[1], 1)) if args.train_noise else 0.0
183+
seed += scipy.random.normal(scale=args.train_noise, size=(seed.shape[0], seed.shape[1], 1))\
184+
if args.train_noise else 0.0
184185

185186
orig = scipy.misc.fromimage(orig).astype(np.float32)
186187

@@ -441,7 +442,7 @@ def compile(self):
441442
# Helper function for rendering test images during training, or standalone inference mode.
442443
input_tensor, seed_tensor = T.tensor4(), T.tensor4()
443444
input_layers = {self.network['img']: input_tensor, self.network['seed']: seed_tensor}
444-
output = lasagne.layers.get_output([self.network[k] for k in ['seed', 'out']], input_layers, deterministic=True)
445+
output = lasagne.layers.get_output([self.network[k] for k in ['seed','out']], input_layers, deterministic=True)
445446
self.predict = theano.function([seed_tensor], output)
446447

447448
if not args.train: return
@@ -541,7 +542,8 @@ def train(self):
541542
print(' - generator {}'.format(' '.join(gen_info)))
542543

543544
real, fake = stats[:args.batch_size], stats[args.batch_size:]
544-
print(' - discriminator', real.mean(), len(np.where(real > 0.5)[0]), fake.mean(), len(np.where(fake < -0.5)[0]))
545+
print(' - discriminator', real.mean(), len(np.where(real > 0.5)[0]),
546+
fake.mean(), len(np.where(fake < -0.5)[0]))
545547
if epoch == args.adversarial_start-1:
546548
print(' - generator now optimizing against discriminator.')
547549
self.model.adversary_weight.set_value(args.adversary_weight)

0 commit comments

Comments
 (0)