Skip to content

Commit fd3cfd3

Browse files
committed
move resources to new storage account
1 parent 821ccc9 commit fd3cfd3

File tree

8 files changed

+24
-25
lines changed

8 files changed

+24
-25
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<p align="center">
44
<a href="https://gen.studio/">
5-
<img width="512" src="https://deepartstorage.blob.core.windows.net/public/assets/gen_studio.gif">
5+
<img width="512" src="https://mmlsparkdemo.blob.core.windows.net/met/assets/gen_studio.gif">
66
</a>
77
</p>
88

@@ -33,13 +33,13 @@ GANs are a special kind of deep network capable of modeling distributions of dat
3333
In [Gen Studio](https://gen.studio/) we use a GAN to sample from the space of art in [The Metropolitan Museum of Art's Open Access Collection](https://www.metmuseum.org/about-the-met/policies-and-documents/open-access).
3434

3535
<p align="center">
36-
<img width="512" src="https://deepartstorage.blob.core.windows.net/public/assets/gan-architecture.jpg">
36+
<img width="512" src="https://mmlsparkdemo.blob.core.windows.net/met//assets/gan-architecture.jpg">
3737
</p>
3838

3939
A GAN is made up of two dueling deep networks: A Generator and a Discriminator. The generator aims to create new art, and the discriminator aims to critique the art and distinguish it from existing art. Both networks are trained in competition until the generator can fool the descriminator and create realistic works of art.
4040

4141
<p align="center">
42-
<img width="512" src="https://deepartstorage.blob.core.windows.net/public/assets/training.gif">
42+
<img width="512" src="https://mmlsparkdemo.blob.core.windows.net/met/assets/training.gif">
4343
</p>
4444

4545

@@ -48,45 +48,45 @@ A GAN is made up of two dueling deep networks: A Generator and a Discriminator.
4848

4949

5050
<p align="center">
51-
<img width="512" src="https://deepartstorage.blob.core.windows.net/public/assets/semantic-inversion.jpg">
51+
<img width="512" src="https://mmlsparkdemo.blob.core.windows.net/met/assets/semantic-inversion.jpg">
5252
</p>
5353

5454
GANs are great at generating new works of art, but we wanted to see if the GAN could recreate existing works in The MET's collection. To achieve this, we used a technique called neural network inversion. Instead of learning the weights of a generator network, we keep those weights constant and instead learn the noise pattern to maximize the similarity between the GAN output and a target work. We discovered that one needs to match both the target image's pixels as well as its "high-level" semantic content to be successful.
5555

5656
<p align="center">
57-
<img width="512" src="https://deepartstorage.blob.core.windows.net/public/assets/inversion.gif">
57+
<img width="512" src="https://mmlsparkdemo.blob.core.windows.net/met/assets/inversion.gif">
5858
</p>
5959

6060

6161
### GAN Latent Space Traversal
6262

6363
<p align="center">
64-
<img width="512" src="https://deepartstorage.blob.core.windows.net/public/assets/code-space-interp.jpg">
64+
<img width="512" src="https://mmlsparkdemo.blob.core.windows.net/met/assets/code-space-interp.jpg">
6565
</p>
6666

6767
To explore the spaces between objects in our GAN, we first invert the objects to get their positions in "latent" space. This latent space is learned by the network, and each point in it corresponds to a unique artwork when mapped through the generator network. To interpolate between the points we use plain-old vector interpolation, though depending on the noise you train your GAN with, you might get better performance by transforming to spherical coordinates before the interpolation (because of [the magic of high dimensional gaussians](https://www.cs.cmu.edu/~avrim/598/chap2only.pdf)).
6868

6969

7070
<p align="center">
71-
<img width="80%" src="https://deepartstorage.blob.core.windows.net/public/assets/interpolation.gif">
71+
<img width="80%" src="https://mmlsparkdemo.blob.core.windows.net/met/assets/interpolation.gif">
7272
</p>
7373

7474
### Reverse Image Search
7575

7676
<p align="center">
77-
<img width="80%" src="https://deepartstorage.blob.core.windows.net/public/assets/nn-lookup.jpg">
77+
<img width="80%" src="https://mmlsparkdemo.blob.core.windows.net/met/assets/nn-lookup.jpg">
7878
</p>
7979

8080
To create a reverse image search engine, we first map the MET's images into a space where distance is more meaningful, aka the output of a truncated pretrained ResNet50 model. In this space, images that seem similar to us are close together. Furthermore, their positions are roughly invariant to small image transformations like scaling, brightness, rotations etc. This is starkly opposed to pixel space, where imperceptibly small translations like scaling or rotating can completely change the distance between images. Once we have all of the Met's images featurized, we create an efficient nearest neighbor lookup tree frequently referred to as a [k-d tree](https://en.wikipedia.org/wiki/K-d_tree). This lets us lookup approximate nearest neighbors in feature space without comparing our image to the entirty of the MET collection. At each node of this tree, we store the pointer to the MET image so that we can quickly return it to the caller. We use [the annoy library](https://github.com/spotify/annoy) for fast NN indexes.
8181

8282
<p align="center">
83-
<img width="80%" src="https://deepartstorage.blob.core.windows.net/public/assets/nearest_neighbors.jpg">
83+
<img width="80%" src="https://mmlsparkdemo.blob.core.windows.net/met/assets/nearest_neighbors.jpg">
8484
</p>
8585

8686
# Architecture
8787

8888
<p align="center">
89-
<img width="100%" src="https://deepartstorage.blob.core.windows.net/public/assets/architecture.svg">
89+
<img width="100%" src="https://mmlsparkdemo.blob.core.windows.net/met/assets/architecture.svg">
9090
</p>
9191

9292

api/ImageSimilarity/model/Featurize Images.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
],
204204
"metadata": {
205205
"kernelspec": {
206-
"display_name": "Python [default]",
206+
"display_name": "Python 3",
207207
"language": "python",
208208
"name": "python3"
209209
},
@@ -217,7 +217,7 @@
217217
"name": "python",
218218
"nbconvert_exporter": "python",
219219
"pygments_lexer": "ipython3",
220-
"version": "3.5.5"
220+
"version": "3.7.3"
221221
}
222222
},
223223
"nbformat": 4,

utilities/transition video.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ def generate(label_A, label_B, seed_A, seed_B, num_interps=5):
9999

100100
def getData(objectID):
101101
print("getting data")
102-
URL = "https://deepartstorage.blob.core.windows.net/public/inverted/biggan1/seeds/{}.json".format(objectID)
102+
URL = "https://mmlsparkdemo.blob.core.windows.net/met/inverted/biggan1/seeds/{}.json".format(objectID)
103103
response = urlopen(URL)
104104
data = json.load(response)
105105
return data
106106

107107
def getInversion(objectID):
108-
URL = "https://deepartstorage.blob.core.windows.net/public/inverted/biggan1/images/{}.png".format(objectID)
108+
URL = "https://mmlsparkdemo.blob.core.windows.net/met/inverted/biggan1/images/{}.png".format(objectID)
109109
with urlopen(URL) as url:
110110
f = BytesIO(url.read())
111111
img = Image.open(f)
@@ -119,7 +119,7 @@ def makeSquare(img):
119119
return layer
120120

121121
def getOriginal(objectID):
122-
URL = "https://deepartstorage.blob.core.windows.net/public/thumbnails4/{}.jpg".format(objectID)
122+
URL = "https://mmlsparkdemo.blob.core.windows.net/met/thumbnails/{}.jpg".format(objectID)
123123
with urlopen(URL) as url:
124124
f = BytesIO(url.read())
125125
img = Image.open(f)

website/public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
<meta name="twitter:card" content="summary_large_image" />
3434
<meta name="twitter:title" content="Gen Studio" />
3535
<meta name="twitter:description" content="Create novel works of art with a Generative Adversarial Network (GAN) and explore The Metropolitan Museum of Art's open access collection" />
36-
<meta name="twitter:image" content="https://deepartstorage.blob.core.windows.net/public/assets/genstudio_screenshot.jpg" />
36+
<meta name="twitter:image" content="https://mmlsparkdemo.blob.core.windows.net/met/assets/genstudio_screenshot.jpg" />
3737

3838
<meta property="og:title" content="Gen Studio"/>
3939
<meta property="og:type" content="article"/>
40-
<meta property="og:image" content="https://deepartstorage.blob.core.windows.net/public/assets/genstudio_screenshot.jpg"/>
40+
<meta property="og:image" content="https://mmlsparkdemo.blob.core.windows.net/met/assets/genstudio_screenshot.jpg"/>
4141
<meta property="og:description" content="Create novel works of art with a Generative Adversarial Network (GAN) and explore The Metropolitan Museum of Art's open access collection"/>
4242
</head>
4343
<body>

website/src/ExplorePage/ExplorePage.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default class ExplorePage extends Component {
3636
*/
3737
objIDsToImages(objIDs) {
3838
const baseURL =
39-
"https://deepartstorage.blob.core.windows.net/public/thumbnails3/";
39+
"https://mmlsparkdemo.blob.core.windows.net/met/thumbnails";
4040

4141
let apiURLs = objIDs.map(ID => ({
4242
url: baseURL + ID.toString(),
@@ -102,7 +102,7 @@ export default class ExplorePage extends Component {
102102
});
103103

104104
const imageToSeedUrl =
105-
"https://deepartstorage.blob.core.windows.net/public/inverted/biggan1/seeds/";
105+
"https://mmlsparkdemo.blob.core.windows.net/met/inverted/biggan1/seeds/";
106106
const fileName = response.objectID.toString() + ".json";
107107
const Http2 = new XMLHttpRequest();
108108
Http2.open("GET", imageToSeedUrl + fileName);

website/src/ExplorePage/PaletteBox.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class PaletteBox extends Component {
4242
}
4343

4444
getSeed(){
45-
const imageToSeedUrl="https://deepartstorage.blob.core.windows.net/public/inverted/biggan1/seeds/";
45+
const imageToSeedUrl="https://mmlsparkdemo.blob.core.windows.net/met/inverted/biggan1/seeds/";
4646
const fileName = this.props.id.toString()+".json";
4747
const Http = new XMLHttpRequest();
4848
Http.open("GET", imageToSeedUrl+fileName);

website/src/MapPage/map.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function setupPlotly(stateHolder, objIDs, firstID) {
1414
const maxX = 1.3;
1515
const TIME_TILL_CALL = 350;
1616
const CLOSE_DIST = .05;
17-
const thumbnailRoot = "https://deepartstorage.blob.core.windows.net/public/thumbnails4/";
17+
const thumbnailRoot = "https://mmlsparkdemo.blob.core.windows.net/met/thumbnails/";
1818
var lastTimeCalled = Date.now();
1919

2020
var isMobile = (typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1);
@@ -190,7 +190,7 @@ export function setupPlotly(stateHolder, objIDs, firstID) {
190190
* @param {Int[]} paintingIds - Array of art ID's
191191
*/
192192
function populateImageSeeds(paintingIds){
193-
const imageToSeedUrl = "https://deepartstorage.blob.core.windows.net/public/inverted/biggan1/seeds/";
193+
const imageToSeedUrl = "https://mmlsparkdemo.blob.core.windows.net/met/inverted/biggan1/seeds/";
194194
var prealloc = [];
195195
paintingIds.forEach(function (id, i) {
196196
prealloc[i] = { latents: [], labels: [] };
@@ -244,7 +244,7 @@ export function setupPlotly(stateHolder, objIDs, firstID) {
244244
apiData: response
245245
})
246246

247-
const imageToSeedUrl = "https://deepartstorage.blob.core.windows.net/public/inverted/biggan1/seeds/";
247+
const imageToSeedUrl = "https://mmlsparkdemo.blob.core.windows.net/met/inverted/biggan1/seeds/";
248248
const fileName = response.objectID.toString() + ".json";
249249
const Http2 = new XMLHttpRequest();
250250
Http2.open("GET", imageToSeedUrl + fileName);
@@ -300,7 +300,6 @@ export function setupPlotly(stateHolder, objIDs, firstID) {
300300

301301
if (checkIfNotSuperClose(ids, distances)) {
302302
const ratios = Softmax(scalarMultiplyVector(distances, -6));
303-
//console.log(ratios);
304303
let totalLatent = new Array(140).fill(0);
305304
let totalLabel = new Array(1000).fill(0);
306305
ratios.forEach(function (r, i) {

website/src/SelectPage/SelectPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class SelectPage extends Component {
209209
* @param {Int[]} objIDs - An array of object IDs from the met API to convert to an array of image urls
210210
*/
211211
objIDsToImages(objIDs) {
212-
const baseURL = 'https://deepartstorage.blob.core.windows.net/public/thumbnails4/';
212+
const baseURL = 'https://mmlsparkdemo.blob.core.windows.net/met/thumbnails/';
213213

214214
let imgObjs = objIDs.map(ID => ({ img: baseURL + ID.toString() + '.jpg', id: ID, key: ID }));
215215

0 commit comments

Comments
 (0)