1
0
Fork 0
mirror of synced 2024-05-04 13:02:26 +12:00
- Add `webgen/gen.rb` to generate web page from template
- Add support for mobile browser
- Change layouts
This commit is contained in:
nagadomi 2016-02-07 05:53:58 +09:00
parent af1898122f
commit 122ffd37fe
28 changed files with 1344 additions and 455 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 765 B

View file

@ -1,15 +0,0 @@
Flag icons are downloaded from here: https://www.gosquared.com/download/pixels/flags.zip
Text from LICENSE.txt file (MIT license, GPL-compatible):
Copyright (c) 2013 Go Squared Ltd. http://www.gosquared.com/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,77 +1,146 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<title>waifu2x</title>
<link rel="shortcut icon" href="favicon.ico"/>
<meta id="viewport" name="viewport" content="width=780">
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<script type="text/javascript" src="ui.js"></script>
</head>
<body>
<div class="allPage">
<div class="mainTitle"><!--
--><div class="mainTitle-text">waifu2x</div><!--
--><a href="index.html" class="flagLink first"><img src="img/flags/US.png" class="chooseLang"></a><!--
--><a href="index.ja.html" class="flagLink"><img src="img/flags/JP.png" class="chooseLang"></a><!--
--><a href="index.ru.html" class="flagLink"><img src="img/flags/RU.png" class="chooseLang"></a><!--
--></div>
<p>Single-Image Super-Resolution for Anime-Style Art using Deep Convolutional Neural Networks. And it supports photo.</p>
<p class="margin1 linksBox"><a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" class="blueLink" target="_blank">Show full demonstration</a> | <a href="https://github.com/nagadomi/waifu2x" class="blueLink" target="_blank">Go to GitHub</a></p>
<img src="img/example2-zip.png" class="example">
<div class="secondTitle">Convert image:</div>
<form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
<div class="optionBox first">
<div class="option-left">Image choosing:</div>
<div class="option-right">
<input type="text" id="url" name="url" placeholder="Type URL">
<div class="option-right-small">Or choose a file: <input type="file" id="file" name="file"></div>
</div>
<div class="option-hint">Limits: Size: 2MB, Noise Reduction: 2560x2560px, Upscaling: 1280x1280px.</div>
</div>
<div class="optionBox">
<div class="option-left">Style:</div>
<div class="option-right">
<label><input type="radio" name="style" class="radio" value="art" checked><span class="r-text">Artwork</span></label>
<label><input type="radio" name="style" class="radio" value="photo"><span class="r-text">Photo</span></label>
</div>
</div>
<div class="optionBox">
<div class="option-left">Noise Reduction:<div class="option-left-small">(expect JPEG artifact)</div></div>
<div class="option-right">
<label><input type="radio" name="noise" class="radio" value="0"><span class="r-text">None</span></label>
<label><input type="radio" name="noise" class="radio" value="1" checked><span class="r-text">Medium</span></label>
<label><input type="radio" name="noise" class="radio" value="2"><span class="r-text">High</span></label>
<label><input type="radio" name="noise" class="radio" value="3"><span class="r-text">Super (tmp)</span></label>
</div>
<div class="option-hint">You need use noise reduction if image actually has noise or it may cause opposite effect.</div>
</div>
<div class="optionBox">
<div class="option-left">Upscaling:<div class="option-left-small"></div></div>
<div class="option-right">
<label><input type="radio" name="scale" class="radio" value="0" checked><span class="r-text">None</span></label>
<label><input type="radio" name="scale" class="radio" value="1"><span class="r-text">1.6x</span></label>
<label><input type="radio" name="scale" class="radio" value="2"><span class="r-text">2x</span></label>
</div>
</div>
<input type="submit" class="button" value="Convert">
<input type="submit" name="download" value="Download" class="button">
<div class="bottomHint">If you are using Firefox, Please press the CTRL+S key to save image. "Save Image" option doesn't work.</div>
<!--<div class="bottomHint">This website uses Google Analytics to help us improve the website content.</div>-->
</form>
</div>
<div class="bottomInfo">
<a href="https://github.com/nagadomi/waifu2x" class="grayLink" target="_blank">waifu2x</a>
</div>
</body>
<html lang="en">
<!-- This file was automatically generated by webgen/gen.rb. Do not make changes to this file manually. -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<link rel="shortcut icon" href="favicon.ico"/>
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<link href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<link href="mobile.css" rel="stylesheet" type="text/css" media="screen and (max-width: 768px) and (min-width: 0px)">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<script type="text/javascript" src="ui.js"></script>
<title>waifu2x</title>
</head>
<body>
<div class="all-page">
<h1 class="main-title">waifu2x</h1>
<div class="choose-lang">
<a href="index.html">
English
</a>
/
<a href="index.ja.html">
日本語
</a>
/
<a href="index.ru.html">
Русский
</a>
/
<a href="index.pt.html">
Português
</a>
</div>
<p>Single-Image Super-Resolution for Anime-Style Art using Deep Convolutional Neural Networks. And it supports photo.</p>
<p class="margin1 link-box">
<a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" class="blue-link" target="_blank">
Show full demonstration
</a>
|
<a href="https://github.com/nagadomi/waifu2x" class="blue-link" target="_blank">
Go to GitHub
</a>
</p>
<form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
<div class="option-box first">
<div class="option-left">Image choosing:</div>
<div class="option-right">
<input type="text" id="url" name="url" placeholder="Type URL">
<div class="option-right-small">
Or choose a file:
<input type="file" id="file" name="file"></div>
</div>
<div class="option-hint">
Limits: Size: 2MB, Noise Reduction: 2560x2560px, Upscaling: 1280x1280px.
</div>
</div>
<div class="option-box">
<div class="option-left">
Style:
</div>
<div class="option-right">
<label><input type="radio" name="style" class="radio" value="art" checked>
<span class="r-text">
Artwork
</span>
</label>
<label><input type="radio" name="style" class="radio" value="photo">
<span class="r-text">
Photo
</span>
</label>
</div>
</div>
<div class="option-box">
<div class="option-left">
Noise Reduction:
<div class="option-left-small">
(expect JPEG artifact)
</div>
</div>
<div class="option-right">
<label><input type="radio" name="noise" class="radio" value="0">
<span class="r-text">
None
</span>
</label>
<label><input type="radio" name="noise" class="radio" value="1" checked>
<span class="r-text">
Medium
</span>
</label>
<label>
<input type="radio" name="noise" class="radio" value="2">
<span class="r-text">
High
</span>
</label>
</div>
<div class="option-hint">
You need use noise reduction if image actually has noise or it may cause opposite effect.
</div>
</div>
<div class="option-box">
<div class="option-left">
Upscaling:
<div class="option-left-small"></div>
</div>
<div class="option-right">
<label><input type="radio" name="scale" class="radio" value="0" checked>
<span class="r-text">
None
</span>
</label>
<label><input type="radio" name="scale" class="radio" value="1">
<span class="r-text">
1.6x
</span>
</label>
<label><input type="radio" name="scale" class="radio" value="2">
<span class="r-text">
2x
</span>
</label>
</div>
</div>
<input type="submit" class="button" value="Convert">
<input type="submit" name="download" value="Download" class="button">
<div class="bottom-hint">
<ul>
<li>If you are using Firefox, Please press the CTRL+S key to save image. "Save Image" option doesn't work.</li>
</ul>
</div>
</form>
</div>
<div class="bottom-info">
<a href="https://github.com/nagadomi/waifu2x" class="gray-link" target="_blank">waifu2x</a>
</div>
</body>
</html>

View file

@ -1,77 +1,146 @@
<!DOCTYPE html>
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<title>waifu2x</title>
<link rel="shortcut icon" href="favicon.ico"/>
<meta id="viewport" name="viewport" content="width=780">
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<script type="text/javascript" src="ui.js"></script>
</head>
<body>
<div class="allPage">
<div class="mainTitle"><!--
--><div class="mainTitle-text">waifu2x</div><!--
--><a href="index.html" class="flagLink first"><img src="img/flags/US.png" class="chooseLang"></a><!--
--><a href="index.ja.html" class="flagLink"><img src="img/flags/JP.png" class="chooseLang"></a><!--
--><a href="index.ru.html" class="flagLink"><img src="img/flags/RU.png" class="chooseLang"></a><!--
--></div>
<p>深層畳み込みニューラルネットワークによる二次元画像のための超解像システム。 写真にも対応。</p>
<p class="margin1 linksBox"><a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" class="blueLink" target="_blank">デモンストレーションを見ます</a> | <a href="https://github.com/nagadomi/waifu2x" class="blueLink" target="_blank">GitHubに行きます</a></p>
<img src="img/example2-zip.png" class="example">
<div class="secondTitle">画像を変換します:</div>
<form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
<div class="optionBox first">
<div class="option-left">画像:</div>
<div class="option-right">
<input type="text" id="url" name="url" placeholder="URLを書いてか">
<div class="option-right-small">ファイルを選んでください: <input type="file" id="file" name="file"></div>
</div>
<div class="option-hint">制限: サイズ: 2MB, ノイズ除去: 2560x2560px, 拡大後: 1280x1280px</div>
</div>
<div class="optionBox">
<div class="option-left">スタイル:</div>
<div class="option-right">
<label><input type="radio" name="style" class="radio" value="art" checked><span class="r-text">イラスト</span></label>
<label><input type="radio" name="style" class="radio" value="photo"><span class="r-text">写真</span></label>
</div>
</div>
<div class="optionBox">
<div class="option-left">ノイズ除去:<div class="option-left-small">(JPEGイズを想定)</div></div>
<div class="option-right">
<label><input type="radio" name="noise" class="radio" value="0"><span class="r-text">なし</span></label>
<label><input type="radio" name="noise" class="radio" value="1" checked><span class="r-text"></span></label>
<label><input type="radio" name="noise" class="radio" value="2"><span class="r-text"></span></label>
<label><input type="radio" name="noise" class="radio" value="3"><span class="r-text">スーパー</span></label>
</div>
<div class="option-hint">画像はノイズがなければノイズ除去すると逆効果を引き起こす可能性があります。</div>
</div>
<div class="optionBox">
<div class="option-left">拡大:<div class="option-left-small"></div></div>
<div class="option-right">
<label><input type="radio" name="scale" class="radio" value="0" checked><span class="r-text">なし</span></label>
<label><input type="radio" name="scale" class="radio" value="1"><span class="r-text">1.6x</span></label>
<label><input type="radio" name="scale" class="radio" value="2"><span class="r-text">2x</span></label>
</div>
</div>
<input type="submit" class="button" value="実行">
<input type="submit" name="download" value="結果を保存" class="button">
<div class="bottomHint">Firefoxの方は、右クリから画像が保存できないようなので、CTRL+SキーかALTキー後 ファイル - ページを保存 で画像を保存してください。</div>
<!--<div class="bottomHint">本サイトは、コンテンツ改善のために Google Analytics を使用しています。 </div>-->
</form>
</div>
<div class="bottomInfo">
<a href="https://github.com/nagadomi/waifu2x" class="grayLink" target="_blank">waifu2x</a>
</div>
</body>
<!-- This file was automatically generated by webgen/gen.rb. Do not make changes to this file manually. -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<link rel="shortcut icon" href="favicon.ico"/>
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<link href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<link href="mobile.css" rel="stylesheet" type="text/css" media="screen and (max-width: 768px) and (min-width: 0px)">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<script type="text/javascript" src="ui.js"></script>
<title>waifu2x</title>
</head>
<body>
<div class="all-page">
<h1 class="main-title">waifu2x</h1>
<div class="choose-lang">
<a href="index.html">
English
</a>
/
<a href="index.ja.html">
日本語
</a>
/
<a href="index.ru.html">
Русский
</a>
/
<a href="index.pt.html">
Português
</a>
</div>
<p>深層畳み込みニューラルネットワークによる二次元画像のための超解像システム。 写真にも対応。</p>
<p class="margin1 link-box">
<a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" class="blue-link" target="_blank">
実行例を表示
</a>
|
<a href="https://github.com/nagadomi/waifu2x" class="blue-link" target="_blank">
プロジェクトページ(GitHub)
</a>
</p>
<form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
<div class="option-box first">
<div class="option-left">画像を選択:</div>
<div class="option-right">
<input type="text" id="url" name="url" placeholder="URLを入力">
<div class="option-right-small">
ファイルを選択:
<input type="file" id="file" name="file"></div>
</div>
<div class="option-hint">
制限: サイズ: 3MB, ノイズ除去: 2560x2560px, 拡大(前): 1280x1280px.
</div>
</div>
<div class="option-box">
<div class="option-left">
スタイル:
</div>
<div class="option-right">
<label><input type="radio" name="style" class="radio" value="art" checked>
<span class="r-text">
イラスト
</span>
</label>
<label><input type="radio" name="style" class="radio" value="photo">
<span class="r-text">
写真
</span>
</label>
</div>
</div>
<div class="option-box">
<div class="option-left">
ノイズ除去:
<div class="option-left-small">
(JPEGイズを想定)
</div>
</div>
<div class="option-right">
<label><input type="radio" name="noise" class="radio" value="0">
<span class="r-text">
なし
</span>
</label>
<label><input type="radio" name="noise" class="radio" value="1" checked>
<span class="r-text">
</span>
</label>
<label>
<input type="radio" name="noise" class="radio" value="2">
<span class="r-text">
</span>
</label>
</div>
<div class="option-hint">
イズ除去は細部が消えることがあります。JPEGイズがある場合に使用します。
</div>
</div>
<div class="option-box">
<div class="option-left">
拡大:
<div class="option-left-small"></div>
</div>
<div class="option-right">
<label><input type="radio" name="scale" class="radio" value="0" checked>
<span class="r-text">
なし
</span>
</label>
<label><input type="radio" name="scale" class="radio" value="1">
<span class="r-text">
1.6x
</span>
</label>
<label><input type="radio" name="scale" class="radio" value="2">
<span class="r-text">
2x
</span>
</label>
</div>
</div>
<input type="submit" class="button" value="実行">
<input type="submit" name="download" value="実行結果を保存" class="button">
<div class="bottom-hint">
<ul>
<li>Firefoxの方は、右クリから画像が保存できないようなので、CTRL+SキーかALTキー後 ファイル - ページを保存 で画像を保存してください。</li>
</ul>
</div>
</form>
</div>
<div class="bottom-info">
<a href="https://github.com/nagadomi/waifu2x" class="gray-link" target="_blank">waifu2x</a>
</div>
</body>
</html>

View file

@ -1,66 +1,146 @@
<!DOCTYPE html>
<html>
<!DOCTYPE html>
<html lang="pt">
<!-- This file was automatically generated by webgen/gen.rb. Do not make changes to this file manually. -->
<head>
<meta charset="UTF-8">
<title>waifu2x</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<link rel="shortcut icon" href="favicon.ico"/>
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<link href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<link href="mobile.css" rel="stylesheet" type="text/css" media="screen and (max-width: 768px) and (min-width: 0px)">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<script type="text/javascript" src="ui.js"></script>
<title>waifu2x</title>
</head>
<body>
<h1>waifu2x</h1>
<div class="header">
<div class="github-banner">
<img class="github-banner-image" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png">
<a class="github-banner-link" href="https://github.com/nagadomi/waifu2x" target="_blank"></a>
<div class="all-page">
<h1 class="main-title">waifu2x</h1>
<div class="choose-lang">
<a href="index.html">
English
</a>
/
<a href="index.ja.html">
日本語
</a>
/
<a href="index.ru.html">
Русский
</a>
/
<a href="index.pt.html">
Português
</a>
</div>
<a href="index.html">en</a>/<a href="index.ja.html">ja</a>/<a href="index.ru.html">ru</a>/<a href="index.pt.html">pt</a>
<p>Single-Image Super-Resolution for Anime-Style Art using Deep Convolutional Neural Networks. And it supports photo.</p>
<p class="margin1 link-box">
<a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" class="blue-link" target="_blank">
Sobre
</a>
|
<a href="https://github.com/nagadomi/waifu2x" class="blue-link" target="_blank">
Ir para Github
</a>
</p>
<form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
<div class="option-box first">
<div class="option-left">Imagem:</div>
<div class="option-right">
<input type="text" id="url" name="url" placeholder="URL">
<div class="option-right-small">
ARQUIVO:
<input type="file" id="file" name="file"></div>
</div>
<div class="option-hint">
Limites: Tamanho: 2MB, Redução de ruído: 2560x2560px, Aumento de escala: 1280x1280px.
</div>
</div>
<div class="option-box">
<div class="option-left">
Estilo:
</div>
<div class="option-right">
<label><input type="radio" name="style" class="radio" value="art" checked>
<span class="r-text">
Arte
</span>
</label>
<label><input type="radio" name="style" class="radio" value="photo">
<span class="r-text">
Foto
</span>
</label>
</div>
</div>
<div class="option-box">
<div class="option-left">
Redução de ruído:
<div class="option-left-small">
(Exceto artefato JPEG)
</div>
</div>
<div class="option-right">
<label><input type="radio" name="noise" class="radio" value="0">
<span class="r-text">
Nenhuma
</span>
</label>
<label><input type="radio" name="noise" class="radio" value="1" checked>
<span class="r-text">
Média
</span>
</label>
<label>
<input type="radio" name="noise" class="radio" value="2">
<span class="r-text">
Alta
</span>
</label>
</div>
<div class="option-hint">
Quando usando a escala 2x, Nós nunca recomendamos usar um nível alto de redução de ruído, quase sempre deixa a imagem pior, faz sentido apenas para casos raros quando a imagem tinha uma qualidade muito má desde o começo.
</div>
</div>
<div class="option-box">
<div class="option-left">
Aumento de escala:
<div class="option-left-small"></div>
</div>
<div class="option-right">
<label><input type="radio" name="scale" class="radio" value="0" checked>
<span class="r-text">
Nenhum
</span>
</label>
<label><input type="radio" name="scale" class="radio" value="1">
<span class="r-text">
1.6x
</span>
</label>
<label><input type="radio" name="scale" class="radio" value="2">
<span class="r-text">
2x
</span>
</label>
</div>
</div>
<input type="submit" class="button" value="Converter">
<input type="submit" name="download" value="Baixar" class="button">
<div class="bottom-hint">
<ul>
<li>Se Você estiver usando o Firefox, por favor, aperte CTRL+S para salvar a imagem. A opção "Salvar Imagem" não funciona</li>
</ul>
</div>
</form>
</div>
<div class="about">
<div>Single-Image Super-Resolution for Anime-Style Art using Deep Convolutional Neural Networks. And it supports photo. <a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" target="_blank">sobre</a>.</div>
<div></div>
</div>
<form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
<fieldset>
<legend>Imagem</legend>
<div>
URL: <input id="url" type="text" name="url" style="width:400px"> ou
</div>
<div>
ARQUIVO: <input id="file" type="file" name="file">
</div>
<div class="help">
Limites: Tamanho: 2MB, Redução de ruído: 2560x2560px, Aumento de escala: 1280x1280px
</div>
</fieldset>
<fieldset>
<legend>Estilo</legend>
<label><input type="radio" name="style" value="art" checked>Arte</label>
<label><input type="radio" name="style" value="photo">Foto</label>
</fieldset>
<fieldset class="noise-field">
<legend>Redução de ruído (Exceto artefato JPEG)</legend>
<label><input type="radio" name="noise" value="0"> Nenhuma</label>
<label><input type="radio" name="noise" value="1" checked="checked"> Média</label>
<label><input type="radio" name="noise" value="2"> Alta</label>
<div class="help">
Quando usando a escala 2x, Nós nunca recomendamos usar um nível alto de redução de ruído, quase sempre deixa a imagem pior, faz sentido apenas para casos raros quando a imagem tinha uma qualidade muito má desde o começo.
</div>
</fieldset>
<fieldset>
<legend>Aumento de escala</legend>
<label><input type="radio" name="scale" value="0" checked="checked"> Nenhum</label>
<label><input type="radio" name="scale" value="1"> 1.6x</label>
<label><input type="radio" name="scale" value="2"> 2x</label>
</fieldset>
<input type="submit" class="button"/><br>
<input type="submit" name="download" value="Download" class="button"/>
</form>
<div class="help">
<ul class="padding-left">
<li>Se Você estiver usando o Firefox, por favor, aperte CTRL+S para salvar a imagem. A opção "Salvar Imagem" não funciona
</ul>
<div class="bottom-info">
<a href="https://github.com/nagadomi/waifu2x" class="gray-link" target="_blank">waifu2x</a>
</div>
</body>
</html>

View file

@ -1,78 +1,146 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<title>waifu2x</title>
<link rel="shortcut icon" href="favicon.ico"/>
<meta id="viewport" name="viewport" content="width=780">
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<script type="text/javascript" src="ui.js"></script>
</head>
<body>
<div class="allPage">
<div class="mainTitle"><!--
--><div class="mainTitle-text">waifu2x</div><!--
--><a href="index.html" class="flagLink first"><img src="img/flags/US.png" class="chooseLang"></a><!--
--><a href="index.ja.html" class="flagLink"><img src="img/flags/JP.png" class="chooseLang"></a><!--
--><a href="index.ru.html" class="flagLink"><img src="img/flags/RU.png" class="chooseLang"></a><!--
--></div>
<p>Waifu2x позволяет увеличивать в 4 раза рисованные изображения, например аниме или арт, а также устранять шум на изображении (преимущественно артефакты сжатия JPEG).</p>
<p>Теперь также поддерживаются фотографии.</p>
<p class="margin1 linksBox"><a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" class="blueLink" target="_blank">Посмотреть полную демонстрацию</a> | <a href="https://github.com/nagadomi/waifu2x" class="blueLink" target="_blank">Перейти на GitHub</a></p>
<img src="img/example2-zip.png" class="example">
<div class="secondTitle">Преобразовать изображение:</div>
<form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
<div class="optionBox first">
<div class="option-left">Выбор изображения:</div>
<div class="option-right">
<input type="text" id="url" name="url" placeholder="Укажите URL">
<div class="option-right-small">Либо выберите файл: <input type="file" id="file" name="file"></div>
</div>
<div class="option-hint">Макс. размер файла — 2MB, устранение шума — макс. 2560x2560px, апскейл — 1280x1280px.</div>
</div>
<div class="optionBox">
<div class="option-left">Тип изображения:</div>
<div class="option-right">
<label><input type="radio" name="style" class="radio" value="art" checked><span class="r-text">Арт</span></label>
<label><input type="radio" name="style" class="radio" value="photo"><span class="r-text">Фотография</span></label>
</div>
</div>
<div class="optionBox">
<div class="option-left">Устранение шума:<div class="option-left-small">(артефактов JPEG)</div></div>
<div class="option-right">
<label><input type="radio" name="noise" class="radio" value="0"><span class="r-text">Нет</span></label>
<label><input type="radio" name="noise" class="radio" value="1" checked><span class="r-text">Средне</span></label>
<label><input type="radio" name="noise" class="radio" value="2"><span class="r-text">Сильно</span></label>
<label><input type="radio" name="noise" class="radio" value="3"><span class="r-text">Очень сильно (эксперим.)</span></label>
</div>
<div class="option-hint">Устранение шума нужно использовать, если на картинке действительно есть шум, иначе это даст противоположный эффект.</div>
</div>
<div class="optionBox">
<div class="option-left">Апскейл:<div class="option-left-small">(увеличение размера)</div></div>
<div class="option-right">
<label><input type="radio" name="scale" class="radio" value="0" checked><span class="r-text">Нет</span></label>
<label><input type="radio" name="scale" class="radio" value="1"><span class="r-text">1.6x</span></label>
<label><input type="radio" name="scale" class="radio" value="2"><span class="r-text">2x</span></label>
</div>
</div>
<input type="submit" class="button" value="Преобразовать">
<input type="submit" name="download" value="Скачать" class="button">
<div class="bottomHint">Если Вы используете Firefox, для сохранения изображения нажмите Ctrl+S (перетаскивание изображения и опция "Сохранить изображение" работать не будут).</div>
<!--<div class="bottomHint">Этот сайт использует Google Analytics, чтобы помочь нам повысить качество содержания сайта.</div>-->
</form>
</div>
<div class="bottomInfo">
<a href="https://github.com/nagadomi/waifu2x" class="grayLink" target="_blank">waifu2x</a>
</div>
</body>
<!-- This file was automatically generated by webgen/gen.rb. Do not make changes to this file manually. -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<link rel="shortcut icon" href="favicon.ico"/>
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<link href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<link href="mobile.css" rel="stylesheet" type="text/css" media="screen and (max-width: 768px) and (min-width: 0px)">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<script type="text/javascript" src="ui.js"></script>
<title>waifu2x</title>
</head>
<body>
<div class="all-page">
<h1 class="main-title">waifu2x</h1>
<div class="choose-lang">
<a href="index.html">
English
</a>
/
<a href="index.ja.html">
日本語
</a>
/
<a href="index.ru.html">
Русский
</a>
/
<a href="index.pt.html">
Português
</a>
</div>
<p>Waifu2x позволяет увеличивать в 4 раза рисованные изображения, например аниме или арт, а также устранять шум на изображении (преимущественно артефакты сжатия JPEG). Теперь также поддерживаются фотографии.</p>
<p class="margin1 link-box">
<a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" class="blue-link" target="_blank">
Посмотреть полную демонстрацию
</a>
|
<a href="https://github.com/nagadomi/waifu2x" class="blue-link" target="_blank">
Перейти на GitHub
</a>
</p>
<form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
<div class="option-box first">
<div class="option-left">Выбор изображения:</div>
<div class="option-right">
<input type="text" id="url" name="url" placeholder="Укажите URL">
<div class="option-right-small">
Либо выберите файл:
<input type="file" id="file" name="file"></div>
</div>
<div class="option-hint">
Макс. размер файла — 2MB, устранение шума — макс. 2560x2560px, апскейл — 1280x1280px.
</div>
</div>
<div class="option-box">
<div class="option-left">
Тип изображения:
</div>
<div class="option-right">
<label><input type="radio" name="style" class="radio" value="art" checked>
<span class="r-text">
Арт
</span>
</label>
<label><input type="radio" name="style" class="radio" value="photo">
<span class="r-text">
Фотография
</span>
</label>
</div>
</div>
<div class="option-box">
<div class="option-left">
Устранение шума:
<div class="option-left-small">
(артефактов JPEG)
</div>
</div>
<div class="option-right">
<label><input type="radio" name="noise" class="radio" value="0">
<span class="r-text">
Нет
</span>
</label>
<label><input type="radio" name="noise" class="radio" value="1" checked>
<span class="r-text">
Средне
</span>
</label>
<label>
<input type="radio" name="noise" class="radio" value="2">
<span class="r-text">
Сильно
</span>
</label>
</div>
<div class="option-hint">
Устранение шума нужно использовать, если на картинке действительно есть шум, иначе это даст противоположный эффект.
</div>
</div>
<div class="option-box">
<div class="option-left">
Апскейл:
<div class="option-left-small"></div>
</div>
<div class="option-right">
<label><input type="radio" name="scale" class="radio" value="0" checked>
<span class="r-text">
Нет
</span>
</label>
<label><input type="radio" name="scale" class="radio" value="1">
<span class="r-text">
1.6x
</span>
</label>
<label><input type="radio" name="scale" class="radio" value="2">
<span class="r-text">
2x
</span>
</label>
</div>
</div>
<input type="submit" class="button" value="Преобразовать">
<input type="submit" name="download" value="Скачать" class="button">
<div class="bottom-hint">
<ul>
<li>Если Вы используете Firefox, для сохранения изображения нажмите Ctrl+S (перетаскивание изображения и опция "Сохранить изображение" работать не будут).</li>
</ul>
</div>
</form>
</div>
<div class="bottom-info">
<a href="https://github.com/nagadomi/waifu2x" class="gray-link" target="_blank">waifu2x</a>
</div>
</body>
</html>

28
assets/mobile.css Normal file
View file

@ -0,0 +1,28 @@
body {
width: 98%;
font-size: 100%;
}
.all-page {
width: auto;
margin: 1em auto;
padding: 1em;
}
.main-title {
display: block;
}
.option-left {
width: auto;
display: block;
}
#url {
width: 100%;
height: 2em;
}
.option-right {
display: block;
}
.button {
min-width: 10px;
width: 100%;
height: 3em;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

View file

@ -1,165 +1,190 @@
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; vertical-align: top; background: transparent; } /*Reset style*/
button::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner, input[type="submit"]::-moz-focus-inner, input[type="submit"]::-moz-focus-inner, input[type="file"] > input[type="button"]::-moz-focus-inner { border: none; } input[type="checkbox"]:focus { -moz-outline-offset: -1px !important; -moz-outline: 1px solid #000 !important; } :focus { outline: none; } /*Remove a dotted line around 1) buttons, 2) checkboxes, 3) links*/
a { text-decoration: none; cursor: pointer; color: inherit; } a:hover { text-decoration: underline; }
div, span, a, input { background-repeat: no-repeat; }
button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner
{
border: none;
}
input[type="checkbox"]:focus {
-moz-outline-offset: -1px !important;
-moz-outline: 1px solid #000 !important;
}
:focus {
outline: none;
} /*Remove a dotted line around 1) buttons, 2) checkboxes, 3) links*/
a {
text-decoration: none;
cursor: pointer;
color: inherit;
}
a:hover {
text-decoration: underline;
}
div, span, a, input {
background-repeat: no-repeat;
}
body {
width: 782px;
margin: 0 auto;
background: #fff;
color: #000;
font-size: 14px;
font-family: Tahoma, Arial, Verdana, Meiryo, "MS Gothic", sans-serif, Lucida Sans;
line-height: 1.5em;
text-align: center;
width: 782px;
margin: 0 auto;
background: #ccc;
color: #000;
font-size: 14px;
font-family: Tahoma, Arial, Verdana, Meiryo, "MS Gothic", sans-serif, Lucida Sans;
line-height: 1.5em;
text-align: center;
}
.all-page {
position: relative;
width: 690px;
margin: 15px auto;
padding: 10px 30px 15px 30px;
background: #eee;
border: 2px solid #999;
border-radius: 8px;
text-align: left;
}
.all-page:after {
content: "";
position: absolute;
left: -1px;
top: -1px;
width: 100%;
height: 100%;
height: calc(100% - 2px);
padding: 0 1px;
box-shadow: 0px 5px 8px #bbb;
z-index: -1;
} /*for crop shadow bottom for 4px (2px from border and 2px from calc)*/
.main-title {
font-size: 2em;
font-weight: bold;
margin: 0.6em 0;
white-space: nowrap;
display: inline-block;
}
.allPage {
position: relative;
width: 690px;
margin: 15px auto;
padding: 10px 30px 15px 30px;
background: #eee;
border: 2px solid #999;
text-align: left;
}
.allPage:after { content: ""; position: absolute; left: -1px; top: -1px; width: 100%; height: 100%; height: calc(100% - 2px); padding: 0 1px; box-shadow: 0px 5px 8px #bbb; z-index: -1; } /*for crop shadow bottom for 4px (2px from border and 2px from calc)*/
.mainTitle {
font-size: 2em;
font-weight: bold;
margin: 0.6em 0;
white-space: nowrap;
}
.mainTitle-text {
display: inline-block;
}
.flagLink {
display: inline-block;
}
.flagLink.first { margin-left: 20px; }
.chooseLang {
width: 24px;
height: 24px;
margin: 0 5px;
opacity: 0.9;
vertical-align: middle;
.choose-lang {
font-size: 0.8em;
margin: 0 5px;
opacity: 0.9;
vertical-align: middle;
}
p {
margin: 0.4em 0;
margin: 0.4em 0;
}
p.margin1 { margin: 0.9em 0; }
.linksBox {
color: #999;
.links-box {
color: #999;
}
.example {
width: 445px;
height: 200px;
width: 445px;
height: 200px;
}
.blueLink {
color: #36b;
.blue-link {
color: #36b;
}
.grayLink {
color: #999;
.gray-link {
color: #999;
}
.secondTitle {
font-size: 1.5em;
font-weight: bold;
margin: 2.4em 0 1.2em;
line-height: 1.3em;
.second-title {
font-size: 1.5em;
font-weight: bold;
margin: 1em 0 1em;
line-height: 1.3em;
}
.optionBox {
margin: 1.5em 0;
white-space: nowrap;
.option-box {
margin: 1.5em 0;
white-space: nowrap;
}
.option-left {
display: inline-block;
width: 180px;
color: #707070;
font-weight: bold;
display: inline-block;
width: 180px;
color: #707070;
font-weight: bold;
}
.option-left-small {
font-size: 0.8em;
line-height: 1.5em;
font-size: 0.8em;
line-height: 1.5em;
}
.option-right {
display: inline-block;
white-space: normal;
display: inline-block;
white-space: normal;
vertical-align: top;
}
.option-right-small {
margin-top: 2px;
font-size: 0.9em;
margin-top: 2px;
font-size: 0.9em;
}
.option-hint {
margin: 0.5em 0;
color: #888;
font-size: 0.85em;
line-height: 1.5em;
white-space: normal;
margin: 0.5em 0;
color: #888;
font-size: 0.85em;
line-height: 1.5em;
white-space: normal;
}
#url {
width: 300px;
height: 23px;
padding: 0 3px;
border: 1px solid #b0b0b0;
width: 300px;
height: 23px;
padding: 0 3px;
border: 1px solid #b0b0b0;
}
label {
margin: 0 5px 0 0;
padding: 0;
cursor: pointer;
margin: 0 5px 0 0;
padding: 0;
cursor: pointer;
}
.radio {
margin: 0 4px 0 0;
padding: 0;
cursor: pointer;
vertical-align: middle;
margin: 0 4px 0 0;
padding: 0;
cursor: pointer;
vertical-align: middle;
}
.r-text {
vertical-align: middle;
vertical-align: middle;
}
.radio:checked + .r-text { color: #494; }
.button {
min-width: 160px;
height: 26px;
margin: 0 10px 3px 0;
padding-bottom: 1px;
background: #f2f2f2;
background-image: linear-gradient(to bottom, #f9f9f9, #dadada);
border: 1px solid #999;
border-radius: 1px;
cursor: pointer;
min-width: 160px;
height: 26px;
margin: 0 10px 3px 0;
padding-bottom: 1px;
background: #f2f2f2;
background-image: linear-gradient(to bottom, #f9f9f9, #dadada);
border: 1px solid #999;
border-radius: 1px;
cursor: pointer;
}
.button:hover {
background: #f7f7f7;
background-image: linear-gradient(to bottom, #fefefe, #e2e2e2);
}
.button:hover { background: #f7f7f7; background-image: linear-gradient(to bottom, #fefefe, #e2e2e2); }
.bottomHint {
margin: 0.85em 0;
color: #888;
font-size: 0.85em;
line-height: 1.5em;
.bottom-hint {
margin: 0.85em 0;
color: #888;
font-size: 0.85em;
line-height: 1.5em;
}

View file

@ -1,53 +1,52 @@
$(function (){
var expires = 365;
function clear_file() {
var new_file = $("#file").clone();
new_file.change(clear_url);
$("#file").replaceWith(new_file);
var expires = 365;
function clear_file() {
var new_file = $("#file").clone();
new_file.change(clear_url);
$("#file").replaceWith(new_file);
}
function clear_url() {
$("#url").val("")
}
function on_change_style(e) {
var checked = $("input[name=style]:checked");
if (checked.val() == "art") {
$(".main-title").text("waifu2x");
} else {
$(".main-title").html("w<s>/a/</s>ifu2x");
}
function clear_url() {
$("#url").val("")
$.cookie("style", checked.val(), {expires: expires});
}
function on_change_noise_level(e)
{
var checked = $("input[name=noise]:checked");
$.cookie("noise", checked.val(), {expires: expires});
}
function on_change_scale_factor(e)
{
var checked = $("input[name=scale]:checked");
$.cookie("scale", checked.val(), {expires: expires});
}
function restore_from_cookie()
{
if ($.cookie("style")) {
$("input[name=style]").filter("[value=" + $.cookie("style") + "]").prop("checked", true)
}
function on_change_style(e) {
var checked = $("input[name=style]:checked");
if (checked.val() == "art") {
$(".mainTitle-text").text("waifu2x");
} else {
$(".mainTitle-text").html("w<s>/a/</s>ifu2x");
}
$.cookie("style", checked.val(), {expires: expires});
if ($.cookie("noise")) {
$("input[name=noise]").filter("[value=" + $.cookie("noise") + "]").prop("checked", true)
}
function on_change_noise_level(e)
{
var checked = $("input[name=noise]:checked");
$.cookie("noise", checked.val(), {expires: expires});
if ($.cookie("scale")) {
$("input[name=scale]").filter("[value=" + $.cookie("scale") + "]").prop("checked", true)
}
function on_change_scale_factor(e)
{
var checked = $("input[name=scale]:checked");
$.cookie("scale", checked.val(), {expires: expires});
}
function restore_from_cookie()
{
if ($.cookie("style")) {
$("input[name=style]").filter("[value=" + $.cookie("style") + "]").prop("checked", true)
}
if ($.cookie("noise")) {
$("input[name=noise]").filter("[value=" + $.cookie("noise") + "]").prop("checked", true)
}
if ($.cookie("scale")) {
$("input[name=scale]").filter("[value=" + $.cookie("scale") + "]").prop("checked", true)
}
}
$("#url").change(clear_file);
$("#file").change(clear_url);
$("input[name=style]").change(on_change_style);
$("input[name=noise]").change(on_change_noise_level);
$("input[name=scale]").change(on_change_scale_factor);
}
$("#url").change(clear_file);
$("#file").change(clear_url);
$("input[name=style]").change(on_change_style);
$("input[name=noise]").change(on_change_noise_level);
$("input[name=scale]").change(on_change_scale_factor);
restore_from_cookie();
on_change_style();
on_change_scale_factor();
on_change_noise_level();
restore_from_cookie();
on_change_style();
on_change_scale_factor();
on_change_noise_level();
})

View file

@ -284,13 +284,8 @@ turbo.log.categories = {
local app = turbo.web.Application:new(
{
{"^/$", FormHandler},
{"^/style.css", turbo.web.StaticFileHandler, path.join(ROOT, "assets", "style.css")},
{"^/ui.js", turbo.web.StaticFileHandler, path.join(ROOT, "assets", "ui.js")},
{"^/index.html", turbo.web.StaticFileHandler, path.join(ROOT, "assets", "index.html")},
{"^/index.ja.html", turbo.web.StaticFileHandler, path.join(ROOT, "assets", "index.ja.html")},
{"^/index.ru.html", turbo.web.StaticFileHandler, path.join(ROOT, "assets", "index.ru.html")},
{"^/index.pt.html", turbo.web.StaticFileHandler, path.join(ROOT, "assets", "index.pt.html")},
{"^/api$", APIHandler},
{"^/([%a%.]+)$", turbo.web.StaticFileHandler, path.join(ROOT, "assets/")},
}
)
app:listen(opt.port, "0.0.0.0", {max_body_size = CURL_MAX_SIZE})

BIN
webgen/assets/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

28
webgen/assets/mobile.css Normal file
View file

@ -0,0 +1,28 @@
body {
width: 98%;
font-size: 100%;
}
.all-page {
width: auto;
margin: 1em auto;
padding: 1em;
}
.main-title {
display: block;
}
.option-left {
width: auto;
display: block;
}
#url {
width: 100%;
height: 2em;
}
.option-right {
display: block;
}
.button {
min-width: 10px;
width: 100%;
height: 3em;
}

190
webgen/assets/style.css Normal file
View file

@ -0,0 +1,190 @@
button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner
{
border: none;
}
input[type="checkbox"]:focus {
-moz-outline-offset: -1px !important;
-moz-outline: 1px solid #000 !important;
}
:focus {
outline: none;
} /*Remove a dotted line around 1) buttons, 2) checkboxes, 3) links*/
a {
text-decoration: none;
cursor: pointer;
color: inherit;
}
a:hover {
text-decoration: underline;
}
div, span, a, input {
background-repeat: no-repeat;
}
body {
width: 782px;
margin: 0 auto;
background: #ccc;
color: #000;
font-size: 14px;
font-family: Tahoma, Arial, Verdana, Meiryo, "MS Gothic", sans-serif, Lucida Sans;
line-height: 1.5em;
text-align: center;
}
.all-page {
position: relative;
width: 690px;
margin: 15px auto;
padding: 10px 30px 15px 30px;
background: #eee;
border: 2px solid #999;
border-radius: 8px;
text-align: left;
}
.all-page:after {
content: "";
position: absolute;
left: -1px;
top: -1px;
width: 100%;
height: 100%;
height: calc(100% - 2px);
padding: 0 1px;
box-shadow: 0px 5px 8px #bbb;
z-index: -1;
} /*for crop shadow bottom for 4px (2px from border and 2px from calc)*/
.main-title {
font-size: 2em;
font-weight: bold;
margin: 0.6em 0;
white-space: nowrap;
display: inline-block;
}
.choose-lang {
font-size: 0.8em;
margin: 0 5px;
opacity: 0.9;
vertical-align: middle;
}
p {
margin: 0.4em 0;
}
p.margin1 { margin: 0.9em 0; }
.links-box {
color: #999;
}
.example {
width: 445px;
height: 200px;
}
.blue-link {
color: #36b;
}
.gray-link {
color: #999;
}
.second-title {
font-size: 1.5em;
font-weight: bold;
margin: 1em 0 1em;
line-height: 1.3em;
}
.option-box {
margin: 1.5em 0;
white-space: nowrap;
}
.option-left {
display: inline-block;
width: 180px;
color: #707070;
font-weight: bold;
}
.option-left-small {
font-size: 0.8em;
line-height: 1.5em;
}
.option-right {
display: inline-block;
white-space: normal;
vertical-align: top;
}
.option-right-small {
margin-top: 2px;
font-size: 0.9em;
}
.option-hint {
margin: 0.5em 0;
color: #888;
font-size: 0.85em;
line-height: 1.5em;
white-space: normal;
}
#url {
width: 300px;
height: 23px;
padding: 0 3px;
border: 1px solid #b0b0b0;
}
label {
margin: 0 5px 0 0;
padding: 0;
cursor: pointer;
}
.radio {
margin: 0 4px 0 0;
padding: 0;
cursor: pointer;
vertical-align: middle;
}
.r-text {
vertical-align: middle;
}
.radio:checked + .r-text { color: #494; }
.button {
min-width: 160px;
height: 26px;
margin: 0 10px 3px 0;
padding-bottom: 1px;
background: #f2f2f2;
background-image: linear-gradient(to bottom, #f9f9f9, #dadada);
border: 1px solid #999;
border-radius: 1px;
cursor: pointer;
}
.button:hover {
background: #f7f7f7;
background-image: linear-gradient(to bottom, #fefefe, #e2e2e2);
}
.bottom-hint {
margin: 0.85em 0;
color: #888;
font-size: 0.85em;
line-height: 1.5em;
}

52
webgen/assets/ui.js Normal file
View file

@ -0,0 +1,52 @@
$(function (){
var expires = 365;
function clear_file() {
var new_file = $("#file").clone();
new_file.change(clear_url);
$("#file").replaceWith(new_file);
}
function clear_url() {
$("#url").val("")
}
function on_change_style(e) {
var checked = $("input[name=style]:checked");
if (checked.val() == "art") {
$(".main-title").text("waifu2x");
} else {
$(".main-title").html("w<s>/a/</s>ifu2x");
}
$.cookie("style", checked.val(), {expires: expires});
}
function on_change_noise_level(e)
{
var checked = $("input[name=noise]:checked");
$.cookie("noise", checked.val(), {expires: expires});
}
function on_change_scale_factor(e)
{
var checked = $("input[name=scale]:checked");
$.cookie("scale", checked.val(), {expires: expires});
}
function restore_from_cookie()
{
if ($.cookie("style")) {
$("input[name=style]").filter("[value=" + $.cookie("style") + "]").prop("checked", true)
}
if ($.cookie("noise")) {
$("input[name=noise]").filter("[value=" + $.cookie("noise") + "]").prop("checked", true)
}
if ($.cookie("scale")) {
$("input[name=scale]").filter("[value=" + $.cookie("scale") + "]").prop("checked", true)
}
}
$("#url").change(clear_file);
$("#file").change(clear_url);
$("input[name=style]").change(on_change_style);
$("input[name=noise]").change(on_change_noise_level);
$("input[name=scale]").change(on_change_scale_factor);
restore_from_cookie();
on_change_style();
on_change_scale_factor();
on_change_noise_level();
})

56
webgen/gen.rb Normal file
View file

@ -0,0 +1,56 @@
require 'erb'
require 'yaml'
require 'optparse'
require 'fileutils'
def symbolize_keys(val)
if val.is_a?(Hash)
val.map{|k,v|
[k.to_sym, symbolize_keys(v)]
}.to_h
elsif val.is_a?(Array)
val = val.map{|v| symbolize_keys(v)}
else
val
end
end
def load_locales(dir)
locales = {}
Dir.entries(dir).each do |ent|
if ent =~ /^\w\w.yml$/
lang = File.basename(ent, ".yml")
yml = YAML.load_file(File.join(dir, ent))
if yml
locales[lang.to_sym] = symbolize_keys(yml)
else
locales[lang.to_sym] = {}
end
end
end
locales
end
def copy(indir, outdir)
files = Dir.entries(indir).to_a.map{|ent|
File.join(indir, ent)
}.select{|ent|
File.file?(ent)
}
FileUtils.copy(files, outdir, preserve: true)
end
DIR = File.dirname(__FILE__)
DEFAULT_LANG = :en
LANG_DIR = File.join(DIR, "locales")
OUTPUT_DIR = File.join(DIR, "..", "assets")
DONT_MAKE_CHANGE = "This file was automatically generated by webgen/gen.rb. Do not make changes to this file manually."
locales = load_locales(LANG_DIR)
template = File.read(File.join(DIR, "templates", "index.html.erb"))
erb = ERB.new(template)
locales.each do |lang, locale|
output_path = File.join(OUTPUT_DIR, lang == DEFAULT_LANG ? "index.html" : "index.#{lang}.html")
t = locales[DEFAULT_LANG].merge(locale)
t[:dont_make_change] = DONT_MAKE_CHANGE
t[:lang] = lang.to_s
File.write(output_path, erb.result(binding))
end
copy(File.join(DIR, "assets"), OUTPUT_DIR)

25
webgen/locales/en.yml Normal file
View file

@ -0,0 +1,25 @@
---
title: Waifu2x
description: Single-Image Super-Resolution for Anime-Style Art using Deep Convolutional Neural Networks. And it supports photo.
show_demonstration: Show full demonstration
go_to_github: Go to GitHub
image_choosing: Image choosing
type_url: Type URL
choose_file: Or choose a file
file_limits: "Limits: Size: 2MB, Noise Reduction: 2560x2560px, Upscaling: 1280x1280px."
style: Style
artwork: Artwork
photo: Photo
noise_reduction: Noise Reduction
expect_jpeg: expect JPEG artifact
nr_none: None
nr_medium: Medium
nr_high: High
nr_hint: "You need use noise reduction if image actually has noise or it may cause opposite effect."
upscaling: Upscaling
up_none: None
button_convert: Convert
button_download: Download
hints:
- "If you are using Firefox, Please press the CTRL+S key to save image. \"Save Image\" option doesn't work."

24
webgen/locales/ja.yml Normal file
View file

@ -0,0 +1,24 @@
---
title: Waifu2x
description: 深層畳み込みニューラルネットワークによる二次元画像のための超解像システム。 写真にも対応。
show_demonstration: 実行例を表示
go_to_github: プロジェクトページ(GitHub)
image_choosing: 画像を選択
type_url: URLを入力
choose_file: ファイルを選択
file_limits: "制限: サイズ: 2MB, ノイズ除去: 2560x2560px, 拡大(前): 1280x1280px."
style: スタイル
artwork: イラスト
photo: 写真
noise_reduction: ノイズ除去
expect_jpeg: JPEGイズを想定
nr_none: なし
nr_medium:
nr_high:
nr_hint: "イズ除去は細部が消えることがあります。JPEGイズがある場合に使用します。"
upscaling: 拡大
up_none: なし
button_convert: 実行
button_download: 実行結果を保存
hints:
- "Firefoxの方は、右クリから画像が保存できないようなので、CTRL+SキーかALTキー後 ファイル - ページを保存 で画像を保存してください。"

24
webgen/locales/pt.yml Normal file
View file

@ -0,0 +1,24 @@
---
title: Waifu2x
description: Single-Image Super-Resolution for Anime-Style Art using Deep Convolutional Neural Networks. And it supports photo.
show_demonstration: Sobre
go_to_github: Ir para Github
image_choosing: Imagem
type_url: URL
choose_file: ARQUIVO
file_limits: "Limites: Tamanho: 2MB, Redução de ruído: 2560x2560px, Aumento de escala: 1280x1280px."
style: Estilo
artwork: Arte
photo: Foto
noise_reduction: Redução de ruído
expect_jpeg: Exceto artefato JPEG
nr_none: Nenhuma
nr_medium: Média
nr_high: Alta
nr_hint: "Quando usando a escala 2x, Nós nunca recomendamos usar um nível alto de redução de ruído, quase sempre deixa a imagem pior, faz sentido apenas para casos raros quando a imagem tinha uma qualidade muito má desde o começo."
upscaling: Aumento de escala
up_none: Nenhum
button_convert: Converter
button_download: Baixar
hints:
- "Se Você estiver usando o Firefox, por favor, aperte CTRL+S para salvar a imagem. A opção \"Salvar Imagem\" não funciona"

24
webgen/locales/ru.yml Normal file
View file

@ -0,0 +1,24 @@
---
title: Waifu2x
description: "Waifu2x позволяет увеличивать в 4 раза рисованные изображения, например аниме или арт, а также устранять шум на изображении (преимущественно артефакты сжатия JPEG). Теперь также поддерживаются фотографии."
show_demonstration: Посмотреть полную демонстрацию
go_to_github: Перейти на GitHub
image_choosing: Выбор изображения
type_url: Укажите URL
choose_file: Либо выберите файл
file_limits: "Макс. размер файла — 2MB, устранение шума — макс. 2560x2560px, апскейл — 1280x1280px."
style: Тип изображения
artwork: Арт
photo: Фотография
noise_reduction: Устранение шума
expect_jpeg: артефактов JPEG
nr_none: Нет
nr_medium: Средне
nr_high: Сильно
nr_hint: "Устранение шума нужно использовать, если на картинке действительно есть шум, иначе это даст противоположный эффект."
upscaling: Апскейл
up_none: Нет
button_convert: Преобразовать
button_download: Скачать
hints:
- "Если Вы используете Firefox, для сохранения изображения нажмите Ctrl+S (перетаскивание изображения и опция \"Сохранить изображение\" работать не будут)."

View file

@ -0,0 +1,148 @@
<!DOCTYPE html>
<html lang="<%= t[:lang] %>">
<!-- <%= t[:dont_make_change] %> -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="utf-8">
<link rel="shortcut icon" href="favicon.ico"/>
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<link href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<link href="mobile.css" rel="stylesheet" type="text/css" media="screen and (max-width: 768px) and (min-width: 0px)">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<script type="text/javascript" src="ui.js"></script>
<title>waifu2x</title>
</head>
<body>
<div class="all-page">
<h1 class="main-title">waifu2x</h1>
<div class="choose-lang">
<a href="index.html">
English
</a>
/
<a href="index.ja.html">
日本語
</a>
/
<a href="index.ru.html">
Русский
</a>
/
<a href="index.pt.html">
Português
</a>
</div>
<p><%= t[:description] %></p>
<p class="margin1 link-box">
<a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" class="blue-link" target="_blank">
<%= t[:show_demonstration] %>
</a>
|
<a href="https://github.com/nagadomi/waifu2x" class="blue-link" target="_blank">
<%= t[:go_to_github] %>
</a>
</p>
<form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
<div class="option-box first">
<div class="option-left"><%= t[:image_choosing] %>:</div>
<div class="option-right">
<input type="text" id="url" name="url" placeholder="<%= t[:type_url] %>">
<div class="option-right-small">
<%= t[:choose_file] %>:
<input type="file" id="file" name="file"></div>
</div>
<div class="option-hint">
<%= t[:file_limits] %>
</div>
</div>
<div class="option-box">
<div class="option-left">
<%= t[:style] %>:
</div>
<div class="option-right">
<label><input type="radio" name="style" class="radio" value="art" checked>
<span class="r-text">
<%= t[:artwork] %>
</span>
</label>
<label><input type="radio" name="style" class="radio" value="photo">
<span class="r-text">
<%= t[:photo] %>
</span>
</label>
</div>
</div>
<div class="option-box">
<div class="option-left">
<%= t[:noise_reduction] %>:
<div class="option-left-small">
(<%= t[:expect_jpeg] %>)
</div>
</div>
<div class="option-right">
<label><input type="radio" name="noise" class="radio" value="0">
<span class="r-text">
<%= t[:nr_none] %>
</span>
</label>
<label><input type="radio" name="noise" class="radio" value="1" checked>
<span class="r-text">
<%= t[:nr_medium] %>
</span>
</label>
<label>
<input type="radio" name="noise" class="radio" value="2">
<span class="r-text">
<%= t[:nr_high] %>
</span>
</label>
</div>
<div class="option-hint">
<%= t[:nr_hint] %>
</div>
</div>
<div class="option-box">
<div class="option-left">
<%= t[:upscaling] %>:
<div class="option-left-small"></div>
</div>
<div class="option-right">
<label><input type="radio" name="scale" class="radio" value="0" checked>
<span class="r-text">
<%= t[:up_none] %>
</span>
</label>
<label><input type="radio" name="scale" class="radio" value="1">
<span class="r-text">
1.6x
</span>
</label>
<label><input type="radio" name="scale" class="radio" value="2">
<span class="r-text">
2x
</span>
</label>
</div>
</div>
<% if t[:button_convert] && !t[:button_convert].empty? %>
<input type="submit" class="button" value="<%= t[:button_convert] %>">
<% else %>
<input type="submit" class="button">
<% end %>
<input type="submit" name="download" value="<%= t[:button_download]%>" class="button">
<div class="bottom-hint">
<ul>
<% t[:hints].each do |hint| %>
<li><%= hint %></li>
<% end %>
</ul>
</div>
</form>
</div>
<div class="bottom-info">
<a href="https://github.com/nagadomi/waifu2x" class="gray-link" target="_blank">waifu2x</a>
</div>
</body>
</html>