Skip to content

Commit

Permalink
🚸 Deep Dream using VGG16 model
Browse files Browse the repository at this point in the history
  • Loading branch information
alimoezzi committed Mar 4, 2021
1 parent 108c2b0 commit a794729
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions Deepdream_vgg16_pytorch.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"collapsed": true,
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"# Deep dream with VGG16 model"
]
},
{
"cell_type": "code",
"execution_count": 1,
"outputs": [],
"source": [
"import os\n",
"import torch\n",
"import numpy as np\n",
"from matplotlib import pyplot as plt\n",
"from torch.autograd import Variable\n",
"%matplotlib inline\n",
"import torchvision\n",
"from torchvision.models import vgg16\n",
"from torchvision.transforms import transforms\n",
"from torchsummary import summary\n",
"torch.manual_seed(0)\n",
"torch.backends.cudnn.deterministic = True\n",
"torch.backends.cudnn.benchmark = False\n",
"np.random.seed(0)\n",
"\n",
"def imshow(img):\n",
" npimg = img.numpy()\n",
" plt.figure(figsize = (200,50))\n",
" plt.imshow(np.transpose(npimg, (1, 2, 0)))\n",
" plt.show()"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}

0 comments on commit a794729

Please sign in to comment.