April 2020
Intermediate to advanced
380 pages
9h 24m
English
First, we'll begin by working on the train.py file:
import osfrom data import DIV2Kfrom model.srgan import generator, discriminatorfrom train import SrganTrainer, SrganGeneratorTrainer
The preceding imports bring in some ready-made classes, such as SrganTrainer, SrganGeneratorTrainer, and so on. We will discuss each of them in detail after we've finished working on this file.
weights_dir = 'weights'weights_file = lambda filename: os.path.join(weights_dir, filename)os.makedirs(weights_dir, exist_ok=True)
Read now
Unlock full access