Fix formatting, minor tweaks to Docker build files for release.

main
Alex J. Champandard 9 years ago
parent 448e7b93dc
commit 03914db364

@ -26,9 +26,8 @@ RUN /opt/conda/bin/python3.5 -m pip install -q -r "requirements.txt"
COPY enhance.py . COPY enhance.py .
# Get a pre-trained neural networks, non-commercial & attribution. # Get a pre-trained neural networks, non-commercial & attribution.
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-small-0.1.pkl.bz2" RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne1x-small-0.2.pkl.bz2"
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-medium-0.1.pkl.bz2" RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne2x-small-0.2.pkl.bz2"
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-large-0.1.pkl.bz2"
# Set an entrypoint to the main enhance.py script # Set an entrypoint to the main enhance.py script
ENTRYPOINT ["/opt/conda/bin/python3.5", "enhance.py", "--device=cpu"] ENTRYPOINT ["/opt/conda/bin/python3.5", "enhance.py", "--device=cpu"]

@ -24,9 +24,8 @@ RUN /opt/conda/bin/python3.5 -m pip install -q -r "requirements.txt"
COPY enhance.py . COPY enhance.py .
# Get a pre-trained neural networks, non-commercial & attribution. # Get a pre-trained neural networks, non-commercial & attribution.
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-small-0.1.pkl.bz2" RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne1x-small-0.2.pkl.bz2"
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-medium-0.1.pkl.bz2" RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.2/ne2x-small-0.2.pkl.bz2"
RUN wget -q "https://github.com/alexjc/neural-enhance/releases/download/v0.1/ne4x-large-0.1.pkl.bz2"
# Set an entrypoint to the main enhance.py script # Set an entrypoint to the main enhance.py script
ENTRYPOINT ["/opt/conda/bin/python3.5", "enhance.py", "--device=gpu"] ENTRYPOINT ["/opt/conda/bin/python3.5", "enhance.py", "--device=gpu"]

@ -180,7 +180,8 @@ class DataLoader(threading.Thread):
seed = PIL.Image.open(buffer) seed = PIL.Image.open(buffer)
seed = scipy.misc.fromimage(seed, mode='RGB').astype(np.float32) seed = scipy.misc.fromimage(seed, mode='RGB').astype(np.float32)
seed += scipy.random.normal(scale=args.train_noise, size=(seed.shape[0], seed.shape[1], 1)) if args.train_noise else 0.0 seed += scipy.random.normal(scale=args.train_noise, size=(seed.shape[0], seed.shape[1], 1))\
if args.train_noise else 0.0
orig = scipy.misc.fromimage(orig).astype(np.float32) orig = scipy.misc.fromimage(orig).astype(np.float32)
@ -541,7 +542,8 @@ class NeuralEnhancer(object):
print(' - generator {}'.format(' '.join(gen_info))) print(' - generator {}'.format(' '.join(gen_info)))
real, fake = stats[:args.batch_size], stats[args.batch_size:] real, fake = stats[:args.batch_size], stats[args.batch_size:]
print(' - discriminator', real.mean(), len(np.where(real > 0.5)[0]), fake.mean(), len(np.where(fake < -0.5)[0])) print(' - discriminator', real.mean(), len(np.where(real > 0.5)[0]),
fake.mean(), len(np.where(fake < -0.5)[0]))
if epoch == args.adversarial_start-1: if epoch == args.adversarial_start-1:
print(' - generator now optimizing against discriminator.') print(' - generator now optimizing against discriminator.')
self.model.adversary_weight.set_value(args.adversary_weight) self.model.adversary_weight.set_value(args.adversary_weight)

Loading…
Cancel
Save