Procházet zdrojové kódy

Adding final touches to new Filter functionality, square rendering, and chrominance optimization

Jason Antic před 6 roky
rodič
revize
4ad92207f9

+ 24 - 6
ColorizeTraining.ipynb

@@ -34,7 +34,7 @@
     "from pathlib import Path\n",
     "from itertools import repeat\n",
     "import tensorboardX\n",
-    "torch.cuda.set_device(1)\n",
+    "torch.cuda.set_device(0)\n",
     "plt.style.use('dark_background')\n",
     "torch.backends.cudnn.benchmark=True\n"
    ]
@@ -52,10 +52,10 @@
     "gpath = IMAGENET.parent/(proj_id + '_gen_192.h5')\n",
     "dpath = IMAGENET.parent/(proj_id + '_critic_192.h5')\n",
     "\n",
-    "c_lr=5e-4\n",
+    "c_lr=2e-4\n",
     "c_lrs = np.array([c_lr,c_lr,c_lr])\n",
     "\n",
-    "g_lr=c_lr/5\n",
+    "g_lr=c_lr/4\n",
     "g_lrs = np.array([g_lr/1000,g_lr/100,g_lr])\n",
     "\n",
     "keep_pcts=[0.25,0.25]\n",
@@ -124,17 +124,35 @@
     "scheds.extend(GANTrainSchedule.generate_schedules(szs=[128,128], bss=[8,8], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=keep_pcts, \n",
     "    save_base_name=proj_id, c_lrs=c_lrs/3, g_lrs=g_lrs/3, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=gen_freeze_tos))\n",
     "\n",
+    "#unshock\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[160], bss=[5], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.1], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/80, g_lrs=g_lrs/80, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
+    "\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[160], bss=[5], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/8, g_lrs=g_lrs/8, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
+    "\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[160], bss=[5], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/16, g_lrs=g_lrs/16, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[0]))\n",
     "\n",
     "#unshock\n",
     "scheds.extend(GANTrainSchedule.generate_schedules(szs=[192], bss=[4], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.1], \n",
     "    save_base_name=proj_id, c_lrs=c_lrs/80, g_lrs=g_lrs/80, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
     "\n",
-    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[192], bss=[4], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[192], bss=[3], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
     "    save_base_name=proj_id, c_lrs=c_lrs/8, g_lrs=g_lrs/8, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
     "\n",
-    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[192], bss=[4], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[192], bss=[3], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
     "    save_base_name=proj_id, c_lrs=c_lrs/16, g_lrs=g_lrs/16, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[0]))\n",
     "\n",
+    "#unshock\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[224], bss=[2], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.1], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/160, g_lrs=g_lrs/160, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
+    "\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[224], bss=[2], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/16, g_lrs=g_lrs/16, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
+    "\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[224], bss=[2], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/32, g_lrs=g_lrs/32, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[0]))\n",
     "\n",
     "\n",
     "#unshock\n",
@@ -145,7 +163,7 @@
     "    save_base_name=proj_id, c_lrs=c_lrs/16, g_lrs=g_lrs/16, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
     "\n",
     "scheds.extend(GANTrainSchedule.generate_schedules(szs=[256], bss=[2], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
-    "    save_base_name=proj_id, c_lrs=c_lrs/32, g_lrs=g_lrs/32, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[0]))\n"
+    "    save_base_name=proj_id, c_lrs=c_lrs/32, g_lrs=g_lrs/32, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[0]))"
    ]
   },
   {

+ 31 - 28
ColorizeVisualization.ipynb

@@ -31,12 +31,12 @@
     "from fasterai.modules import *\n",
     "from fasterai.training import *\n",
     "from fasterai.generators import *\n",
+    "from fasterai.filters import *\n",
     "from fastai.torch_imports import *\n",
     "from pathlib import Path\n",
     "from itertools import repeat\n",
     "import tensorboardX\n",
     "torch.cuda.set_device(0)\n",
-    "torch.no_grad()\n",
     "plt.style.use('dark_background')\n",
     "torch.backends.cudnn.benchmark=True"
    ]
@@ -50,8 +50,11 @@
     "IMAGENET = Path('data/imagenet/ILSVRC/Data/CLS-LOC/train')\n",
     "colorizer_path = IMAGENET.parent/('colorize_gen_192.h5')\n",
     "\n",
-    "#Can be bigger for GPUs with more memory.  11GB can take a factor of 21 max.  Performance generally gracefully degrades with lower factors.\n",
-    "render_factor=21"
+    "#The higher the render_factor, the more GPU memory will be used and generally images will look better.  \n",
+    "#11GB can take a factor of 42 max.  Performance generally gracefully degrades with lower factors, \n",
+    "#though you may also find that certiain images will actually render better at lower numbers.  \n",
+    "#This tends to be the case with the oldest photos.\n",
+    "render_factor=42"
    ]
   },
   {
@@ -70,7 +73,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/WomenTapingPlanes.jpg\")"
+    "vis.plot_transformed_image(\"test_images/Chief.jpg\")"
    ]
   },
   {
@@ -79,7 +82,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/BritishDispatchRider.jpg\")"
+    "vis.plot_transformed_image(\"test_images/marilyn_woods.jpg\")"
    ]
   },
   {
@@ -88,7 +91,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/MuseauNacionalDosCoches.jpg\")"
+    "vis.plot_transformed_image(\"test_images/WomenTapingPlanes.jpg\")"
    ]
   },
   {
@@ -97,7 +100,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/RossCorbettHouseCork.jpg\", render_factor=17)"
+    "vis.plot_transformed_image(\"test_images/overmiller.jpg\")"
    ]
   },
   {
@@ -106,7 +109,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/HPLabelleOfficeMontreal.jpg\")"
+    "vis.plot_transformed_image(\"test_images/BritishDispatchRider.jpg\")"
    ]
   },
   {
@@ -115,7 +118,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/overmiller.jpg\")"
+    "vis.plot_transformed_image(\"test_images/MuseauNacionalDosCoches.jpg\")"
    ]
   },
   {
@@ -124,7 +127,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/einstein_beach.jpg\")"
+    "vis.plot_transformed_image(\"test_images/abe.jpg\", render_factor=25)"
    ]
   },
   {
@@ -133,7 +136,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/abe.jpg\", render_factor=12)"
+    "vis.plot_transformed_image(\"test_images/RossCorbettHouseCork.jpg\", render_factor=33)"
    ]
   },
   {
@@ -142,7 +145,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/airmen1943.jpg\")"
+    "vis.plot_transformed_image(\"test_images/HPLabelleOfficeMontreal.jpg\")"
    ]
   },
   {
@@ -151,7 +154,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/20sWoman.jpg\")"
+    "vis.plot_transformed_image(\"test_images/einstein_beach.jpg\")"
    ]
   },
   {
@@ -160,7 +163,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/egypt-1.jpg\")"
+    "vis.plot_transformed_image(\"test_images/airmen1943.jpg\")"
    ]
   },
   {
@@ -169,7 +172,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/Rutherford_Hayes.jpg\")"
+    "vis.plot_transformed_image(\"test_images/20sWoman.jpg\")"
    ]
   },
   {
@@ -178,7 +181,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/einstein_portrait.jpg\")"
+    "vis.plot_transformed_image(\"test_images/egypt-1.jpg\")"
    ]
   },
   {
@@ -187,7 +190,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/pinkerton.jpg\")"
+    "vis.plot_transformed_image(\"test_images/Rutherford_Hayes.jpg\", render_factor=36)"
    ]
   },
   {
@@ -196,7 +199,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/marilyn_woods.jpg\")"
+    "vis.plot_transformed_image(\"test_images/einstein_portrait.jpg\")"
    ]
   },
   {
@@ -205,7 +208,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/WaltWhitman.jpg\")"
+    "vis.plot_transformed_image(\"test_images/pinkerton.jpg\")"
    ]
   },
   {
@@ -214,7 +217,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/dorothea-lange.jpg\")"
+    "vis.plot_transformed_image(\"test_images/WaltWhitman.jpg\")"
    ]
   },
   {
@@ -223,7 +226,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/Hemmingway2.jpg\")"
+    "vis.plot_transformed_image(\"test_images/dorothea-lange.jpg\")"
    ]
   },
   {
@@ -232,7 +235,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/Chief.jpg\")"
+    "vis.plot_transformed_image(\"test_images/Hemmingway2.jpg\")"
    ]
   },
   {
@@ -340,7 +343,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/AnselAdamsYosemite.jpg\")"
+    "vis.plot_transformed_image(\"test_images/AnselAdamsYosemite.jpg\", render_factor=35)"
    ]
   },
   {
@@ -592,7 +595,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/FatMenClub.jpg\")"
+    "vis.plot_transformed_image(\"test_images/FatMenClub.jpg\", render_factor=35)"
    ]
   },
   {
@@ -601,7 +604,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/EgyptColosus.jpg\")"
+    "vis.plot_transformed_image(\"test_images/EgyptColosus.jpg\", render_factor=31)"
    ]
   },
   {
@@ -664,7 +667,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/covered-wagons-traveling.jpg\", render_factor=14)"
+    "vis.plot_transformed_image(\"test_images/covered-wagons-traveling.jpg\", render_factor=19)"
    ]
   },
   {
@@ -718,7 +721,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/bicycles.jpg\")"
+    "vis.plot_transformed_image(\"test_images/bicycles.jpg\",render_factor=17)"
    ]
   },
   {
@@ -925,7 +928,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/1910Racket.png\")"
+    "vis.plot_transformed_image(\"test_images/1910Racket.png\", render_factor=31)"
    ]
   },
   {

+ 0 - 1950
ComboVisualization.ipynb

@@ -1,1950 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "%matplotlib inline\n",
-    "%reload_ext autoreload\n",
-    "%autoreload 2"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "import multiprocessing\n",
-    "import os\n",
-    "from torch import autograd\n",
-    "from fastai.transforms import TfmType\n",
-    "from fasterai.transforms import *\n",
-    "from fastai.conv_learner import *\n",
-    "from fasterai.images import *\n",
-    "from fasterai.dataset import *\n",
-    "from fasterai.visualize import *\n",
-    "from fasterai.callbacks import *\n",
-    "from fasterai.loss import *\n",
-    "from fasterai.modules import *\n",
-    "from fasterai.training import *\n",
-    "from fasterai.generators import *\n",
-    "from fastai.torch_imports import *\n",
-    "from pathlib import Path\n",
-    "from itertools import repeat\n",
-    "import tensorboardX\n",
-    "plt.style.use('dark_background')\n",
-    "torch.backends.cudnn.benchmark=True\n",
-    "colorizer_device = torch.device('cuda:0')\n",
-    "defader_device = torch.device('cuda:1') \n"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "IMAGENET = Path('data/imagenet/ILSVRC/Data/CLS-LOC/train')\n",
-    "\n",
-    "colorizer_path = IMAGENET.parent/('colorize_gen_192.h5')\n",
-    "defader_path = IMAGENET.parent/('defade_rc_gen_256.h5')\n",
-    "\n",
-    "default_sz=400\n",
-    "torch.backends.cudnn.benchmark=True"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "class Generator(nn.Module):\n",
-    "    def __init__(self, colorizer, defader):\n",
-    "        super().__init__()\n",
-    "        self.colorizer = colorizer\n",
-    "        self.defader = defader\n",
-    "        \n",
-    "    def forward(self, x):\n",
-    "        x = self.colorizer(x).detach().to(device=defader_device)\n",
-    "        return self.defader(x)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "colorizer = Unet34(nf_factor=2).cuda(device=colorizer_device)\n",
-    "load_model(colorizer, colorizer_path)\n",
-    "colorizer = colorizer.eval()\n",
-    "\n",
-    "defader = Unet34(nf_factor=2).cuda(device=defader_device)\n",
-    "load_model(defader, defader_path)\n",
-    "defader = defader.eval()\n",
-    "\n",
-    "netG = Generator(colorizer, defader)\n",
-    "netG = netG.eval()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "x_tfms = [BlackAndWhiteTransform()]"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis = ModelImageVisualizer(default_sz=default_sz)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/overmiller.jpg\", netG, tfms=x_tfms, sz=420)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/einstein_beach.jpg\", netG, tfms=x_tfms,sz=600)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/abe.jpg\", netG, tfms=x_tfms, sz=480)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/airmen1943.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/20sWoman.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/egypt-1.jpg\", netG,sz=480)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Rutherford_Hayes.jpg\", netG, tfms=x_tfms, sz=400)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/einstein_portrait.jpg\", netG, tfms=x_tfms, sz=400)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/pinkerton.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/marilyn_woods.jpg\", netG, tfms=x_tfms, sz=440)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/WaltWhitman.jpg\", netG, tfms=x_tfms, sz=280)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/dorothea-lange.jpg\", netG, tfms=x_tfms,sz=460)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Hemmingway2.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Chief.jpg\", netG, tfms=x_tfms,sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/hemmingway.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/smoking_kid.jpg\", netG, tfms=x_tfms,sz=550)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/teddy_rubble.jpg\", netG, tfms=x_tfms, sz=360)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/dustbowl_2.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/camera_man.jpg\", netG, tfms=x_tfms,sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/migrant_mother.jpg\", netG, tfms=x_tfms,sz=590)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/marktwain.jpg\", netG, tfms=x_tfms, sz=530)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/HelenKeller.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Evelyn_Nesbit.jpg\", netG, tfms=x_tfms, sz=580)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Eddie-Adams.jpg\", netG, tfms=x_tfms, sz=460)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/soldier_kids.jpg\", netG, tfms=x_tfms, sz=400)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/AnselAdamsYosemite.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/unnamed.jpg\", netG, tfms=x_tfms, sz=550)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/workers_canyon.jpg\", netG, tfms=x_tfms,sz=570)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/CottonMill.jpg\", netG, tfms=x_tfms,sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/JudyGarland.jpeg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/kids_pit.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/last_samurai.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/AnselAdamsWhiteChurch.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/opium.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/dorothea_lange_2.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/rgs.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/wh-auden.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/w-b-yeats.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/marilyn_portrait.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/wilson-slaverevivalmeeting.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/ww1_trench.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/women-bikers.png\", netG, tfms=x_tfms, sz=450)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Unidentified1855.jpg\", netG, tfms=x_tfms, sz=400)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/skycrapper_lunch.jpg\", netG, tfms=x_tfms, sz=550)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/sioux.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/school_kids.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/royal_family.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/redwood_lumberjacks.jpg\", netG, tfms=x_tfms, sz=550)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/poverty.jpg\", netG, tfms=x_tfms,sz=550)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/paperboy.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/NativeAmericans.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/helmut_newton-.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Greece1911.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/FatMenClub.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/EgyptColosus.jpg\", netG, tfms=x_tfms, sz=400)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/egypt-2.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/dustbowl_sd.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/dustbowl_people.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/dustbowl_5.jpg\", netG, tfms=x_tfms, sz=450)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/dustbowl_1.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/DriveThroughGiantTree.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/covered-wagons-traveling.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/civil-war_2.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/civil_war_4.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/civil_war_3.jpg\", netG, tfms=x_tfms, sz=550)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/civil_war.jpg\", netG, tfms=x_tfms, sz=540)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/BritishSlum.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/bicycles.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/brooklyn_girls_1940s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/40sCouple.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1946Wedding.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Dolores1920s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/TitanicGym.jpg\", netG, tfms=x_tfms, sz=550)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/FrenchVillage1950s.jpg\", netG, tfms=x_tfms, sz=440)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/ClassDivide1930sBrittain.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1870sSphinx.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1890Surfer.png\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/TV1930s.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1864UnionSoldier.jpg\", netG, tfms=x_tfms, sz=510)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1890sMedStudents.png\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/BellyLaughWWI.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/PiggyBackRide.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/HealingTree.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/ManPile.jpg\", netG, tfms=x_tfms, sz=450)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1910Bike.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/FreeportIL.jpg\", netG, tfms=x_tfms, sz=402)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/DutchBabyCoupleEllis.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/InuitWoman1903.png\", netG, tfms=x_tfms, sz=460)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1920sDancing.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/AirmanDad.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1910Racket.png\", netG, tfms=x_tfms, sz=540)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1880Paris.jpg\", netG, tfms=x_tfms, sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Deadwood1860s.png\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1860sSamauris.png\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/LondonUnderground1860.jpg\", netG, tfms=x_tfms, sz=460)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Mid1800sSisters.jpg\", netG, tfms=x_tfms, sz=480)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1860Girls.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/SanFran1851.jpg\", netG, tfms=x_tfms, sz=480)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Kabuki1870s.png\", netG, tfms=x_tfms,sz=450)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Mormons1870s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/EgyptianWomenLate1800s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/PicadillyLate1800s.jpg\", netG, tfms=x_tfms, sz=540)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/SutroBaths1880s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1880sBrooklynBridge.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/ChinaOpiumc1880.jpg\", netG, tfms=x_tfms,sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Locomotive1880s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/ViennaBoys1880s.png\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/VictorianDragQueen1880s.png\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Sami1880s.jpg\", netG, tfms=x_tfms,sz=420)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/ArkansasCowboys1880s.jpg\", netG, tfms=x_tfms, sz=450)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Ballet1890Russia.jpg\", netG, tfms=x_tfms, sz=480)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Rottindean1890s.png\", netG, tfms=x_tfms, sz=540)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1890sPingPong.jpg\", netG, tfms=x_tfms,sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/London1937.png\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Harlem1932.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/OregonTrail1870s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/EasterNyc1911.jpg\", netG, tfms=x_tfms, sz=532)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1899NycBlizzard.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1916Sweeden.jpg\", netG, tfms=x_tfms, sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Edinburgh1920s.jpg\", netG, tfms=x_tfms, sz=480)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1890sShoeShopOhio.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1890sTouristsEgypt.png\", netG, tfms=x_tfms, sz=570)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1938Reading.jpg\", netG, tfms=x_tfms, sz=455)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1850Geography.jpg\", netG, tfms=x_tfms, sz=540)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1901Electrophone.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Texas1938Woman.png\", netG, tfms=x_tfms, sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/MaioreWoman1895NZ.jpg\", netG, tfms=x_tfms, sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/WestVirginiaHouse.jpg\", netG, tfms=x_tfms, sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1920sGuadalope.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1909Chicago.jpg\", netG, tfms=x_tfms, sz=540)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1920sFarmKid.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/ParisLate1800s.jpg\", netG, tfms=x_tfms,sz=410)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1900sDaytonaBeach.png\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1930sGeorgia.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/NorwegianBride1920s.jpg\", netG, tfms=x_tfms, sz=550)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Depression.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1888Slum.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/LivingRoom1920Sweeden.jpg\", netG, tfms=x_tfms, sz=540)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1896NewsBoyGirl.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/PetDucks1927.jpg\", netG, tfms=x_tfms, sz=400)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1899SodaFountain.jpg\", netG, tfms=x_tfms, sz=580)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/TimesSquare1955.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/PuppyGify.jpg\", netG, tfms=x_tfms, sz=510)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1890CliffHouseSF.jpg\", netG, tfms=x_tfms, sz=590)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1908FamilyPhoto.jpg\", netG, tfms=x_tfms, sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1900sSaloon.jpg\", netG, tfms=x_tfms, sz=560)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1890BostonHospital.jpg\", netG, tfms=x_tfms,sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1870Girl.jpg\", netG, tfms=x_tfms, sz=450)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/AustriaHungaryWomen1890s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Shack.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Apsaroke1908.png\", netG, tfms=x_tfms, sz=400)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1948CarsGrandma.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/PlanesManhattan1931.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/WorriedKid1940sNyc.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1920sFamilyPhoto.jpg\", netG, tfms=x_tfms, sz=550)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/CatWash1931.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1940sBeerRiver.jpg\", netG, tfms=x_tfms, sz=400)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/VictorianLivingRoom.jpg\", netG, tfms=x_tfms, sz=560)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1897BlindmansBluff.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1874Mexico.png\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/MadisonSquare1900.jpg\", netG, tfms=x_tfms, sz=450)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1867MusicianConstantinople.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1925Girl.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1907Cowboys.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/WWIIPeeps.jpg\", netG, tfms=x_tfms, sz=460)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/BabyBigBoots.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1895BikeMaidens.jpg\", netG, tfms=x_tfms, sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/IrishLate1800s.jpg\", netG, tfms=x_tfms,sz=500)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/LibraryOfCongress1910.jpg\", netG, tfms=x_tfms,sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1875Olds.jpg\", netG, tfms=x_tfms, sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/SenecaNative1908.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/WWIHospital.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/GreekImmigrants1905.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1892WaterLillies.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/FatMensShop.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/KidCage1930s.png\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/FarmWomen1895.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/NewZealand1860s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/JerseyShore1905.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/LondonKidsEarly1900s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/NYStreetClean1906.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Boston1937.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Cork1905.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/BoxedBedEarly1900s.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/ZoologischerGarten1898.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/EmpireState1930.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Agamemnon1919.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/AppalachianLoggers1901.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/WWISikhs.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/MementoMori1865.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/RepBrennanRadio1922.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Late1800sNative.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/GasPrices1939.jpg\", netG, tfms=x_tfms, sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/1933RockefellerCenter.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/Scotland1919.jpg\", netG, tfms=x_tfms)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "vis.plot_transformed_image(\"test_images/SchoolDance1956.jpg\", netG, tfms=x_tfms, sz=520)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 3",
-   "language": "python",
-   "name": "python3"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 3
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython3",
-   "version": "3.6.5"
-  },
-  "toc": {
-   "colors": {
-    "hover_highlight": "#DAA520",
-    "navigate_num": "#000000",
-    "navigate_text": "#333333",
-    "running_highlight": "#FF0000",
-    "selected_highlight": "#FFD700",
-    "sidebar_border": "#EEEEEE",
-    "wrapper_background": "#FFFFFF"
-   },
-   "moveMenuLeft": true,
-   "nav_menu": {
-    "height": "67px",
-    "width": "252px"
-   },
-   "navigate_menu": true,
-   "number_sections": true,
-   "sideBar": true,
-   "threshold": 4,
-   "toc_cell": false,
-   "toc_section_display": "block",
-   "toc_window_display": false,
-   "widenNotebook": false
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}

+ 24 - 13
DeFadeTraining.ipynb

@@ -34,7 +34,7 @@
     "from pathlib import Path\n",
     "from itertools import repeat\n",
     "import tensorboardX\n",
-    "torch.cuda.set_device(2)\n",
+    "torch.cuda.set_device(3)\n",
     "plt.style.use('dark_background')\n",
     "torch.backends.cudnn.benchmark=True\n"
    ]
@@ -46,24 +46,17 @@
    "outputs": [],
    "source": [
     "IMAGENET = Path('data/imagenet/ILSVRC/Data/CLS-LOC/train')\n",
-    "\n",
     "proj_id = 'defade'\n",
-    "TENSORBOARD_PATH = Path('data/tensorboard/' + proj_id + '_cont2')\n",
-    "\n",
+    "TENSORBOARD_PATH = Path('data/tensorboard/' + proj_id)\n",
     "gpath = IMAGENET.parent/(proj_id + '_gen_192.h5')\n",
     "dpath = IMAGENET.parent/(proj_id + '_critic_192.h5')\n",
-    "\n",
-    "c_lr=5e-4\n",
+    "c_lr=2e-4\n",
     "c_lrs = np.array([c_lr,c_lr,c_lr])\n",
-    "\n",
-    "g_lr=c_lr/5\n",
+    "g_lr=c_lr/4\n",
     "g_lrs = np.array([g_lr/1000,g_lr/100,g_lr])\n",
-    "\n",
     "keep_pcts=[0.25,0.25]\n",
     "gen_freeze_tos=[-1,0]\n",
-    "\n",
     "lrs_unfreeze_factor=1.0\n",
-    "\n",
     "x_tfms = [RandomLighting(0.5, 0.5)]\n",
     "extra_aug_tfms = []\n",
     "torch.backends.cudnn.benchmark=True"
@@ -127,17 +120,35 @@
     "scheds.extend(GANTrainSchedule.generate_schedules(szs=[128,128], bss=[8,8], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=keep_pcts, \n",
     "    save_base_name=proj_id, c_lrs=c_lrs/3, g_lrs=g_lrs/3, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=gen_freeze_tos))\n",
     "\n",
+    "#unshock\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[160], bss=[5], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.1], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/80, g_lrs=g_lrs/80, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
+    "\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[160], bss=[5], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/8, g_lrs=g_lrs/8, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
+    "\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[160], bss=[5], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/16, g_lrs=g_lrs/16, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[0]))\n",
     "\n",
     "#unshock\n",
     "scheds.extend(GANTrainSchedule.generate_schedules(szs=[192], bss=[4], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.1], \n",
     "    save_base_name=proj_id, c_lrs=c_lrs/80, g_lrs=g_lrs/80, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
     "\n",
-    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[192], bss=[4], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[192], bss=[3], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
     "    save_base_name=proj_id, c_lrs=c_lrs/8, g_lrs=g_lrs/8, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
     "\n",
-    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[192], bss=[4], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[192], bss=[3], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
     "    save_base_name=proj_id, c_lrs=c_lrs/16, g_lrs=g_lrs/16, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[0]))\n",
     "\n",
+    "#unshock\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[224], bss=[2], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.1], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/160, g_lrs=g_lrs/160, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
+    "\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[224], bss=[2], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/16, g_lrs=g_lrs/16, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[-1]))\n",
+    "\n",
+    "scheds.extend(GANTrainSchedule.generate_schedules(szs=[224], bss=[2], path=IMAGENET, x_tfms=x_tfms, extra_aug_tfms=extra_aug_tfms, keep_pcts=[0.25], \n",
+    "    save_base_name=proj_id, c_lrs=c_lrs/32, g_lrs=g_lrs/32, lrs_unfreeze_factor=lrs_unfreeze_factor, gen_freeze_tos=[0]))\n",
     "\n",
     "\n",
     "#unshock\n",

+ 17 - 31
DeFadeVisualization.ipynb

@@ -31,24 +31,13 @@
     "from fasterai.modules import *\n",
     "from fasterai.training import *\n",
     "from fasterai.generators import *\n",
+    "from fasterai.filters import *\n",
     "from fastai.torch_imports import *\n",
     "from pathlib import Path\n",
     "from itertools import repeat\n",
     "import tensorboardX\n",
-    "torch.cuda.set_device(0)\n",
+    "torch.cuda.set_device(3)\n",
     "plt.style.use('dark_background')\n",
-    "torch.backends.cudnn.benchmark=True\n"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "IMAGENET = Path('data/imagenet/ILSVRC/Data/CLS-LOC/train')\n",
-    "gpath = IMAGENET.parent/('defade_rc_gen_256.h5')\n",
-    "default_sz=400\n",
     "torch.backends.cudnn.benchmark=True"
    ]
   },
@@ -58,18 +47,14 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "netG = Unet34(nf_factor=2).cuda()\n",
-    "load_model(netG, gpath)\n",
-    "netG = netG.eval()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "x_tfms = []"
+    "IMAGENET = Path('data/imagenet/ILSVRC/Data/CLS-LOC/train')\n",
+    "defader_path = IMAGENET.parent/('defade_rc_gen_192.h5')\n",
+    "\n",
+    "#The higher the render_factor, the more GPU memory will be used and generally images will look better.  \n",
+    "#11GB can take a factor of 42 max.  Performance generally gracefully degrades with lower factors, \n",
+    "#though you may also find that certiain images will actually render better at lower numbers.  \n",
+    "#This tends to be the case with the oldest photos.\n",
+    "render_factor=41"
    ]
   },
   {
@@ -78,7 +63,8 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis = ModelImageVisualizer(default_sz=default_sz)"
+    "filters = [DeFader(gpu=3, weights_path=defader_path)]\n",
+    "vis = ModelImageVisualizer(filters, render_factor=render_factor, results_dir='result_images')"
    ]
   },
   {
@@ -87,7 +73,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/FadedOvermiller.PNG\", netG, tfms=x_tfms)"
+    "vis.plot_transformed_image(\"test_images/FadedOvermiller.PNG\")"
    ]
   },
   {
@@ -96,7 +82,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/FadedSphynx.PNG\", netG, tfms=x_tfms, sz=500)"
+    "vis.plot_transformed_image(\"test_images/FadedSphynx.PNG\")"
    ]
   },
   {
@@ -105,7 +91,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/FadedRacket.PNG\", netG, tfms=x_tfms)"
+    "vis.plot_transformed_image(\"test_images/FadedRacket.PNG\")"
    ]
   },
   {
@@ -114,7 +100,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/FadedDutchBabies.PNG\", netG, tfms=x_tfms, sz=500)"
+    "vis.plot_transformed_image(\"test_images/FadedDutchBabies.PNG\")"
    ]
   },
   {
@@ -123,7 +109,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image(\"test_images/FadedDelores.PNG\", netG, tfms=x_tfms, sz=500)"
+    "vis.plot_transformed_image(\"test_images/FadedDelores.PNG\")"
    ]
   },
   {

+ 16 - 14
DeOldify_colab.ipynb

@@ -29,7 +29,7 @@
     "\n",
     "-Matt Robinson, <matthew67robinson@gmail.com>\n",
     "\n",
-    "NEW: You can now load your files from you own Drive, check the last cell of the notebook for more information."
+    "NEW: You can now load your files from you own Google Drive, check the last cell of the notebook for more information."
    ]
   },
   {
@@ -422,6 +422,7 @@
     "from fasterai.training import *\n",
     "from fasterai.generators import *\n",
     "from fastai.torch_imports import *\n",
+    "from fasterai.filters import *\n",
     "from pathlib import Path\n",
     "from itertools import repeat\n",
     "from google.colab import drive\n",
@@ -515,15 +516,16 @@
    },
    "outputs": [],
    "source": [
-    "default_sz=400\n",
+    "weights_path = 'pretrained_weights.h5'\n",
+    "results_dir='/content/drive/My Drive/deOldifyImages/results'\n",
     "\n",
-    "netG = Unet34(nf_factor=2).cuda()\n",
-    "load_model(netG, 'pretrained_weights.h5')\n",
-    "netG = netG.eval()\n",
-    "\n",
-    "x_tfms = [BlackAndWhiteTransform()]\n",
-    "\n",
-    "vis = ModelImageVisualizer(default_sz=default_sz, results_dir=\"/content/drive/My Drive/deOldifyImages/results\")"
+    "#The higher the render_factor, the more GPU memory will be used and generally images will look better.  \n",
+    "#11GB can take a factor of 42 max.  Performance generally gracefully degrades with lower factors, \n",
+    "#though you may also find that certiain images will actually render better at lower numbers.  \n",
+    "#This tends to be the case with the oldest photos.\n",
+    "render_factor=42\n",
+    "filters = [Colorizer(gpu=0, weights_path=colorizer_path)]\n",
+    "vis = ModelImageVisualizer(filters, render_factor=render_factor, results_dir='result_images')"
    ]
   },
   {
@@ -560,7 +562,7 @@
    "outputs": [],
    "source": [
     "# %matplotlib inline\n",
-    "vis.plot_transformed_image('abe2.jpg', netG, tfms=x_tfms, sz=380)"
+    "vis.plot_transformed_image('abe2.jpg')"
    ]
   },
   {
@@ -594,7 +596,7 @@
    },
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image('family_TV.jpg', netG, tfms=x_tfms, sz=450)"
+    "vis.plot_transformed_image('family_TV.jpg')"
    ]
   },
   {
@@ -638,7 +640,7 @@
    },
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image('Dorothy.jpg', netG, tfms=x_tfms, sz=450)"
+    "vis.plot_transformed_image('Dorothy.jpg')"
    ]
   },
   {
@@ -682,7 +684,7 @@
    },
    "outputs": [],
    "source": [
-    "vis.plot_transformed_image('butch_and_sundance.jpg', netG, tfms=x_tfms, sz=450)"
+    "vis.plot_transformed_image('butch_and_sundance.jpg')"
    ]
   },
   {
@@ -756,7 +758,7 @@
     "for img in os.listdir(\"/content/drive/My Drive/deOldifyImages/\"):\n",
     "  img_path = str(\"/content/drive/My Drive/deOldifyImages/\") + img\n",
     "  if os.path.isfile(img_path):\n",
-    "    vis.plot_transformed_image(img_path, netG, tfms=x_tfms, sz=380)"
+    "    vis.plot_transformed_image(img_path)"
    ]
   }
  ],

+ 28 - 8
fasterai/filters.py

@@ -26,6 +26,11 @@ class Filter(ABC):
     def filter(self, orig_image:ndarray, render_factor:int)->ndarray:
         pass
 
+    def _init_model(self, model:nn.Module, weights_path:Path):
+        load_model(model, weights_path)
+        model.eval()
+        torch.no_grad() 
+
     def _transform(self, orig:ndarray, sz:int):
         for tfm in self.tfms:
             orig,_=tfm(orig, False)
@@ -65,17 +70,19 @@ class Filter(ABC):
         im_array = np.clip(im_array,0,1)
         return misc.toimage(im_array)
 
+    def _unsquare(self, result:ndarray, orig:ndarray):
+        sz = (orig.shape[1], orig.shape[0])
+        return cv2.resize(result, sz, interpolation=cv2.INTER_AREA)  
+
 
 class Colorizer(Filter):
     def __init__(self, gpu:int, weights_path:Path):
         super().__init__(tfms=[BlackAndWhiteTransform()])
         self.model = Unet34(nf_factor=2).cuda(gpu)
-        load_model(self.model, weights_path)
-        self.model.eval()
-        torch.no_grad()
-        self.render_base = 32
+        self._init_model(self.model, weights_path)
+        self.render_base=16
     
-    def filter(self, orig_image:ndarray, render_factor:int=14)->ndarray:
+    def filter(self, orig_image:ndarray, render_factor:int=36)->ndarray:
         render_sz = render_factor * self.render_base
         model_image = self._model_process(self.model, orig=orig_image, sz=render_sz)
         return self._post_process(model_image, orig_image)
@@ -90,11 +97,24 @@ class Colorizer(Filter):
         for tfm in self.tfms:
             orig,_=tfm(orig, False)
 
-        sz = (orig.shape[1], orig.shape[0])
-        raw_color = cv2.resize(raw_color, sz, interpolation=cv2.INTER_AREA)
+        raw_color = self._unsquare(raw_color, orig)
         color_yuv = cv2.cvtColor(raw_color, cv2.COLOR_BGR2YUV)
         #do a black and white transform first to get better luminance values
         orig_yuv = cv2.cvtColor(orig, cv2.COLOR_BGR2YUV)
         hires = np.copy(orig_yuv)
         hires[:,:,1:3] = color_yuv[:,:,1:3]
-        return cv2.cvtColor(hires, cv2.COLOR_YUV2BGR)    
+        return cv2.cvtColor(hires, cv2.COLOR_YUV2BGR)   
+
+#TODO:  May not want to do square rendering here like in colorization- it definitely loses 
+#fidelity visibly (but not too terribly).  Will revisit.
+class DeFader(Filter): 
+    def __init__(self, gpu:int, weights_path:Path):
+        super().__init__(tfms=[])
+        self.model = Unet34(nf_factor=2).cuda(gpu)
+        self._init_model(self.model, weights_path)
+        self.render_base=16    
+
+    def filter(self, orig_image:ndarray, render_factor:int=36)->ndarray:
+        render_sz = render_factor * self.render_base
+        model_image = self._model_process(self.model, orig=orig_image, sz=render_sz)
+        return self._unsquare(model_image, orig_image)

+ 3 - 0
test_images/ArtyThing.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:973377d1fc3a72bb817a7f6b62c23db5fcb4f081377cd974cb3036623664253e
+size 157262

+ 3 - 0
test_images/BritishDispatchRider.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:910245f130d7becb36499a59e0e5a065a16062d8e11fb7980b6a793bd39522e7
+size 409504

+ 0 - 3
test_images/FatMenShop.jpg

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:eaa53d141d687838dca6344d41fb773089ae9bba76572f29ae9e00f37c719307
-size 47550

+ 3 - 0
test_images/FreeportIL_Faded.PNG

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b17a424235cf22ff476b7ae99f52aaa4178ac2e72c19d84893ade26f1591ce25
+size 557751

+ 3 - 0
test_images/HPLabelleOfficeMontreal.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:07ec2d56d800f4ac266ae9037c41213812ee2b8a891bbd664f520fdd2ac33daa
+size 125365

+ 3 - 0
test_images/MingPeu.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:94f87b1d09aa3748f5db23832a918b0057685bafcae4b57efbcc93a17d2bc6eb
+size 708313

+ 3 - 0
test_images/MuseauNacionalDosCoches.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f678eed1534d4373c84c9b07f1bc2c417286e11a050da1de8f1e3c9b860088db
+size 617193

+ 3 - 0
test_images/RossCorbettHouseCork.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8f45ee2b55c8e6c00eca89e95b11e08b201ea7e8ccfdafd9a65dae549cbc129b
+size 311346

+ 3 - 0
test_images/SynagogueInterior.PNG

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:31b821e56c389baca0727040775e8252531d59ed4ed6abb65fb7cd00d1c735e7
+size 655344

+ 3 - 0
test_images/WomenTapingPlanes.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cf57a4cc14c85fcebbcc35d4ed41747a41220081b1d36de02bce5ed4ca640742
+size 303684

+ 3 - 0
test_images/YaleBranchBarnardsExpress.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:2214e58a458d2ed07c5cf59fa2da964acc7d843b27c23cd96876d4e00a9360a0
+size 466481

+ 3 - 0
test_images/big_head_drawing.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a07d428671ff1b9f59dd07210c38e24bba1bd336ab41cd8e03ca138bf8c2dc93
+size 768392

+ 3 - 0
test_images/drawing_wheels.jpg

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:fb691a02054435dbae002fa4e7865226d522d43ff2b8bd8b161c5def0b528b10
+size 234963