April 2020
Intermediate to advanced
380 pages
9h 24m
English
In this section, we shall work on the flask_app.py file, which will be running on the cloud virtual machine as a server. Let's get started:
from flask import Flask, request, jsonify, send_fileimport osimport timefrom matplotlib.image import imsavefrom model.srgan import generatorfrom model import resolve_single
weights_dir = 'weights'weights_file = lambda filename: os.path.join(weights_dir, filename)gan_generator = generator()gan_generator.load_weights(weights_file('gan_generator.h5'))
app = ...
Read now
Unlock full access