-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fra
committed
Dec 11, 2018
1 parent
047abb3
commit 4c2ca88
Showing
27 changed files
with
130 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,18 @@ | ||
from mirror import mirror | ||
from mirror.visualisations import DeepDream | ||
|
||
from PIL import Image | ||
|
||
from torchvision.models import resnet101, resnet18, vgg16 | ||
from torchvision.transforms import ToTensor, Resize, Compose | ||
|
||
# model = resnet101(True) | ||
model = vgg16(True) | ||
|
||
# cat = Image.open("/home/francesco/Documents/mirror/mirror/resources/sky-dd.jpeg") | ||
# create a model | ||
model = vgg16(pretrained=True) | ||
|
||
cat = Image.open("./cat.jpg") | ||
|
||
# | ||
# cat = Image.open("/home/francesco/Documents/mirror/mirror/resources/the_starry_night-wallpaper-1920x1200.jpg") | ||
|
||
# resize the image and make it a tensor | ||
input = Compose([Resize((224,224)), ToTensor()])(cat) | ||
# | ||
# input = Compose([ToTensor()])(cat) | ||
|
||
# add 1 dim for batch | ||
input = input.unsqueeze(0) | ||
|
||
mirror(input, model) | ||
# call mirror with the input and the model | ||
mirror(input, model, visualisations=[DeepDream]) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{ | ||
"main.css": "/static/css/main.8a0d906b.chunk.css", | ||
"main.js": "/static/js/main.33f09332.chunk.js", | ||
"main.js.map": "/static/js/main.33f09332.chunk.js.map", | ||
"static/js/1.bd250341.chunk.js": "/static/js/1.bd250341.chunk.js", | ||
"static/js/1.bd250341.chunk.js.map": "/static/js/1.bd250341.chunk.js.map", | ||
"main.css": "/static/css/main.a67564f8.chunk.css", | ||
"main.js": "/static/js/main.fef9010a.chunk.js", | ||
"main.js.map": "/static/js/main.fef9010a.chunk.js.map", | ||
"static/js/1.6a64618b.chunk.js": "/static/js/1.6a64618b.chunk.js", | ||
"static/js/1.6a64618b.chunk.js.map": "/static/js/1.6a64618b.chunk.js.map", | ||
"runtime~main.js": "/static/js/runtime~main.229c360f.js", | ||
"runtime~main.js.map": "/static/js/runtime~main.229c360f.js.map", | ||
"static/css/main.8a0d906b.chunk.css.map": "/static/css/main.8a0d906b.chunk.css.map", | ||
"static/css/main.a67564f8.chunk.css.map": "/static/css/main.a67564f8.chunk.css.map", | ||
"index.html": "/index.html", | ||
"precache-manifest.c308b7b331ea8e3c4d3b692bf72f5a99.js": "/precache-manifest.c308b7b331ea8e3c4d3b692bf72f5a99.js", | ||
"precache-manifest.128ea1df9a72d8aaff259ac878e1fb66.js": "/precache-manifest.128ea1df9a72d8aaff259ac878e1fb66.js", | ||
"service-worker.js": "/service-worker.js" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.