-
Notifications
You must be signed in to change notification settings - Fork 318
/
arbitrary_stylization.html
43 lines (38 loc) · 1.45 KB
/
arbitrary_stylization.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<link rel="stylesheet" href="./style.css">
<title>mi.ArbitraryStyleTransferNetwork</title>
</head>
<body>
<h1>mi.ArbitraryStyleTransferNetwork</h1>
<p>
<code>ArbitraryStyleTransferNetwork</code> wraps around Reiichiro Nakano's
<a href="https://github.com/reiinakano/arbitrary-image-stylization-tfjs">TensorFlow.js port</a>
of Ghiasi et al.'s <a href="https://arxiv.org/abs/1705.06830">arbitrary stylization model</a>.
The demo below performs stylization on a content/style image pair by
</p>
<ul>
<li>
calling the <code>predictStyleParameters</code> method with the style
image to obtain a style representation, and
</li>
<li>
calling the <code>stylize</code> method with the content image and the
style representation to perform stylization.
</li>
</ul>
<p>
It then displays the result on a canvas via TensorFlow.js' <code>toPixels</code>
function.
</p>
<img id="content" height="256" class="image" src="content.jpg"/>
<img id="style" height="256" class="image" src="style.jpg"/>
<canvas id="stylized" width="192" height="256" class="image"></canvas>
<br>
<button id="stylize" disabled>Stylize</button>
<script src="arbitrary_stylization_bundle.js"></script>
</body>
</html>