浏览代码

Merge from master

nagadomi 9 年之前
父节点
当前提交
8da52d5fb9

+ 2 - 0
appendix/waifu2x.nginx.conf

@@ -13,6 +13,8 @@ map $http_accept_language $lang {
   ~fr fr;
   ~fr fr;
   ~de de;
   ~de de;
   ~tr tr;
   ~tr tr;
+  ~zh-CN zh-CN;
+  ~zh zh-CN;
   ~en en;
   ~en en;
 }
 }
 
 

+ 4 - 0
assets/index.de.html

@@ -49,6 +49,10 @@
 	<a href="index.tr.html">
 	<a href="index.tr.html">
 	  Türkçe
 	  Türkçe
 	</a>
 	</a>
+	/
+	<a href="index.zh-CN.html">
+	  简体中文
+	</a>
       </div>
       </div>
       <p>Einzelbild Super-Auflösungs Konvertierung für Bilder im Anime Stil mithilfe eines faltenden neuralen Netzwerks. Zusätzlich dazu unterstützt es auch Fotos.</p>
       <p>Einzelbild Super-Auflösungs Konvertierung für Bilder im Anime Stil mithilfe eines faltenden neuralen Netzwerks. Zusätzlich dazu unterstützt es auch Fotos.</p>
       <p class="margin1 link-box">
       <p class="margin1 link-box">

+ 4 - 0
assets/index.es.html

@@ -49,6 +49,10 @@
 	<a href="index.tr.html">
 	<a href="index.tr.html">
 	  Türkçe
 	  Türkçe
 	</a>
 	</a>
+	/
+	<a href="index.zh-CN.html">
+	  简体中文
+	</a>
       </div>
       </div>
       <p>Mejora la resolución de ilustraciones de tipo anime utilizando redes neuronales convolucionales. También es compatible con fotografías.</p>
       <p>Mejora la resolución de ilustraciones de tipo anime utilizando redes neuronales convolucionales. También es compatible con fotografías.</p>
       <p class="margin1 link-box">
       <p class="margin1 link-box">

+ 16 - 12
assets/index.fr.html

@@ -49,8 +49,12 @@
 	<a href="index.tr.html">
 	<a href="index.tr.html">
 	  Türkçe
 	  Türkçe
 	</a>
 	</a>
+	/
+	<a href="index.zh-CN.html">
+	  简体中文
+	</a>
       </div>
       </div>
-      <p>Outil d'agrandissement de dessins de style anime, employant des réseaux de neurones convolutionnels. Fonctionne aussi sur des photos.</p>
+      <p>Outil permettant d'agrandir n'importe quelle image de style "anime", par le biais de réseaux de neurones convolutionnels. Fonctionne également sur les photos.</p>
       <p class="margin1 link-box">
       <p class="margin1 link-box">
 	<a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" class="blue-link" target="_blank">
 	<a href="https://raw.githubusercontent.com/nagadomi/waifu2x/master/images/slide.png" class="blue-link" target="_blank">
 	  Voir une démonstration
 	  Voir une démonstration
@@ -62,20 +66,20 @@
       </p>
       </p>
       <form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
       <form action="/api" method="POST" enctype="multipart/form-data" target="_blank">
 	<div class="option-box first">
 	<div class="option-box first">
-	  <div class="option-left">Sélection de l'image:</div>
+	  <div class="option-left">Sélection de l'image :</div>
 	  <div class="option-right">
 	  <div class="option-right">
-	    <input type="text" id="url" name="url" placeholder="Entrer un URL">
+	    <input type="text" id="url" name="url" placeholder="Entrez une URL">
 	    <div class="option-right-small">
 	    <div class="option-right-small">
-	      Ou utiliser un fichier: 
+	      Ou choisissez un fichier : 
 	      <input type="file" id="file" name="file"></div>
 	      <input type="file" id="file" name="file"></div>
 	  </div>
 	  </div>
 	  <div class="option-hint">
 	  <div class="option-hint">
-	    Limites : Taille : 3MB, Réduction du bruit : 2560x2560px, Agrandissement : 1280x1280px.
+	    Limites : Taille : 3 Mo, Réduction du bruit numérique, 2560x2560px, Agrandissement : 1280x1280px.
 	  </div>
 	  </div>
 	</div>
 	</div>
 	<div class="option-box">
 	<div class="option-box">
 	  <div class="option-left">
 	  <div class="option-left">
-	    Style:
+	    Style :
 	  </div>
 	  </div>
 	  <div class="option-right">
 	  <div class="option-right">
 	    <label><input type="radio" name="style" class="radio" value="art" checked>
 	    <label><input type="radio" name="style" class="radio" value="art" checked>
@@ -92,9 +96,9 @@
 	</div>
 	</div>
 	<div class="option-box">
 	<div class="option-box">
 	  <div class="option-left">
 	  <div class="option-left">
-	    Réduction du bruit:
+	    Réduction du bruit numérique :
 	    <div class="option-left-small">
 	    <div class="option-left-small">
-	      (des artefacts JPEG risquent d'apparaître)
+	      (des artéfacts JPEG risquent d'apparaître)
 	    </div>
 	    </div>
 	  </div>
 	  </div>
 	  <div class="option-right">
 	  <div class="option-right">
@@ -117,17 +121,17 @@
 	    <label>
 	    <label>
 	      <input type="radio" name="noise" class="radio" value="3">
 	      <input type="radio" name="noise" class="radio" value="3">
 	      <span class="r-text">
 	      <span class="r-text">
-		Highest
+		Maximale
 	      </span>
 	      </span>
 	    </label>
 	    </label>
 	  </div>
 	  </div>
 	  <div class="option-hint">
 	  <div class="option-hint">
-	    Il est nécessaire d'utiliser la réduction du bruit si l'image possède du bruit. Autrement, cela risque de causer l'effet opposé.
+	    Il n'est nécessaire d'utiliser cette option qu'en présence de bruit numérique sur l'image. Si ce n'est pas le cas, l'effet obtenu sera contraire à celui recherché.
 	  </div>
 	  </div>
 	</div>
 	</div>
 	<div class="option-box">
 	<div class="option-box">
 	  <div class="option-left">
 	  <div class="option-left">
-	    Agrandissement:
+	    Agrandissement :
 	    <div class="option-left-small"></div>
 	    <div class="option-left-small"></div>
 	  </div>
 	  </div>
 	  <div class="option-right">
 	  <div class="option-right">
@@ -155,7 +159,7 @@
 	<div class="bottom-hint">
 	<div class="bottom-hint">
 	  <ul>
 	  <ul>
 	    
 	    
-	      <li>Si vous utilisez Firefox, utilisez Ctrl+S pour enregistrer l'image. L'option "Enregistrer l'image" ne fonctionne pas.</li>
+	      <li>Note aux utilisateurs de Firefox : L'option "Enregistrer l'image" ne fonctionne pas. Merci d'utiliser Ctrl+S pour enregistrer l'image. </li>
 	    
 	    
 	  </ul>
 	  </ul>
 	</div>
 	</div>

+ 4 - 0
assets/index.html

@@ -49,6 +49,10 @@
 	<a href="index.tr.html">
 	<a href="index.tr.html">
 	  Türkçe
 	  Türkçe
 	</a>
 	</a>
+	/
+	<a href="index.zh-CN.html">
+	  简体中文
+	</a>
       </div>
       </div>
       <p>Single-Image Super-Resolution for Anime-Style Art using Deep Convolutional Neural Networks. And it supports photo.</p>
       <p>Single-Image Super-Resolution for Anime-Style Art using Deep Convolutional Neural Networks. And it supports photo.</p>
       <p class="margin1 link-box">
       <p class="margin1 link-box">

+ 4 - 0
assets/index.ja.html

@@ -49,6 +49,10 @@
 	<a href="index.tr.html">
 	<a href="index.tr.html">
 	  Türkçe
 	  Türkçe
 	</a>
 	</a>
+	/
+	<a href="index.zh-CN.html">
+	  简体中文
+	</a>
       </div>
       </div>
       <p>深層畳み込みニューラルネットワークによる二次元画像のための超解像システム。 写真にも対応。</p>
       <p>深層畳み込みニューラルネットワークによる二次元画像のための超解像システム。 写真にも対応。</p>
       <p class="margin1 link-box">
       <p class="margin1 link-box">

+ 4 - 0
assets/index.pt.html

@@ -49,6 +49,10 @@
 	<a href="index.tr.html">
 	<a href="index.tr.html">
 	  Türkçe
 	  Türkçe
 	</a>
 	</a>
+	/
+	<a href="index.zh-CN.html">
+	  简体中文
+	</a>
       </div>
       </div>
       <p>Single-Image Super-Resolution for Anime-Style Art using Deep Convolutional Neural Networks. And it supports photo.</p>
       <p>Single-Image Super-Resolution for Anime-Style Art using Deep Convolutional Neural Networks. And it supports photo.</p>
       <p class="margin1 link-box">
       <p class="margin1 link-box">

+ 4 - 0
assets/index.ru.html

@@ -49,6 +49,10 @@
 	<a href="index.tr.html">
 	<a href="index.tr.html">
 	  Türkçe
 	  Türkçe
 	</a>
 	</a>
+	/
+	<a href="index.zh-CN.html">
+	  简体中文
+	</a>
       </div>
       </div>
       <p>Waifu2x позволяет увеличивать в 4 раза рисованные изображения, например аниме или арт, а также устранять шум на изображении (преимущественно артефакты сжатия JPEG). Теперь также поддерживаются фотографии.</p>
       <p>Waifu2x позволяет увеличивать в 4 раза рисованные изображения, например аниме или арт, а также устранять шум на изображении (преимущественно артефакты сжатия JPEG). Теперь также поддерживаются фотографии.</p>
       <p class="margin1 link-box">
       <p class="margin1 link-box">

+ 4 - 0
assets/index.tr.html

@@ -49,6 +49,10 @@
 	<a href="index.tr.html">
 	<a href="index.tr.html">
 	  Türkçe
 	  Türkçe
 	</a>
 	</a>
+	/
+	<a href="index.zh-CN.html">
+	  简体中文
+	</a>
       </div>
       </div>
       <p>Derin Sarmalı Sinirsel Ağ ile çalışan anime stili çalışmalar için süper çözünürlük yükselticidir. Normal fotoğrafları da destekler.</p>
       <p>Derin Sarmalı Sinirsel Ağ ile çalışan anime stili çalışmalar için süper çözünürlük yükselticidir. Normal fotoğrafları da destekler.</p>
       <p class="margin1 link-box">
       <p class="margin1 link-box">

+ 172 - 0
assets/index.zh-CN.html

@@ -0,0 +1,172 @@
+<!DOCTYPE html> 
+<html lang="zh-CN">
+  <!-- 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>
+	/
+	<a href="index.es.html">
+	  Español
+	</a>
+	/
+	<a href="index.fr.html">
+	  Français
+	</a>
+	/
+	<a href="index.de.html">
+	  Deutsch
+	</a>
+	/
+	<a href="index.tr.html">
+	  Türkçe
+	</a>
+	/
+	<a href="index.zh-CN.html">
+	  简体中文
+	</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="输入图像链接">
+	    <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>
+	    <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="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 address">
+      <a href="https://github.com/nagadomi/waifu2x" class="gray-link" target="_blank">waifu2x</a>
+    </div>
+  </body>
+</html>

+ 1 - 1
assets/style.css

@@ -111,7 +111,7 @@ p.margin1 { margin: 0.9em 0; }
 
 
 .option-left {
 .option-left {
     display: inline-block;
     display: inline-block;
-    width: 180px;
+    width: 220px;
     color: #707070;
     color: #707070;
     font-weight: bold;
     font-weight: bold;
 }
 }

+ 1 - 1
lib/image_loader.lua

@@ -53,7 +53,7 @@ function image_loader.encode_png(rgb, options)
    if options.gamma then
    if options.gamma then
       im:gamma(options.gamma)
       im:gamma(options.gamma)
    end
    end
-   return im:depth(options.depth):format("PNG"):toString(9)
+   return im:depth(options.depth):format("PNG"):toString()
 end
 end
 function image_loader.save_png(filename, rgb, options)
 function image_loader.save_png(filename, rgb, options)
    local blob = image_loader.encode_png(rgb, options)
    local blob = image_loader.encode_png(rgb, options)

+ 3 - 0
web.lua

@@ -317,6 +317,7 @@ local index_es = file.read(path.join(ROOT, "assets", "index.es.html"))
 local index_fr = file.read(path.join(ROOT, "assets", "index.fr.html"))
 local index_fr = file.read(path.join(ROOT, "assets", "index.fr.html"))
 local index_de = file.read(path.join(ROOT, "assets", "index.de.html"))
 local index_de = file.read(path.join(ROOT, "assets", "index.de.html"))
 local index_tr = file.read(path.join(ROOT, "assets", "index.tr.html"))
 local index_tr = file.read(path.join(ROOT, "assets", "index.tr.html"))
+local index_zh_cn = file.read(path.join(ROOT, "assets", "index.zh-CN.html"))
 local index_en = file.read(path.join(ROOT, "assets", "index.html"))
 local index_en = file.read(path.join(ROOT, "assets", "index.html"))
 function FormHandler:get()
 function FormHandler:get()
    local lang = self.request.headers:get("Accept-Language")
    local lang = self.request.headers:get("Accept-Language")
@@ -339,6 +340,8 @@ function FormHandler:get()
 	 self:write(index_de)
 	 self:write(index_de)
       elseif langs[1] == "tr" then
       elseif langs[1] == "tr" then
 	 self:write(index_tr)
 	 self:write(index_tr)
+      elseif langs[1] == "zh-CN" or langs[1] == "zh" then
+	 self:write(index_zh_cn)
       else
       else
 	 self:write(index_en)
 	 self:write(index_en)
       end
       end

+ 1 - 1
webgen/assets/style.css

@@ -111,7 +111,7 @@ p.margin1 { margin: 0.9em 0; }
 
 
 .option-left {
 .option-left {
     display: inline-block;
     display: inline-block;
-    width: 180px;
+    width: 220px;
     color: #707070;
     color: #707070;
     font-weight: bold;
     font-weight: bold;
 }
 }

+ 1 - 1
webgen/gen.rb

@@ -21,7 +21,7 @@ end
 def load_locales(dir)
 def load_locales(dir)
   locales = {}
   locales = {}
   Dir.entries(dir).each do |ent|
   Dir.entries(dir).each do |ent|
-    if ent =~ /^\w\w.yml$/
+    if ent =~ /\.yml$/
       lang = File.basename(ent, ".yml")
       lang = File.basename(ent, ".yml")
       yml = YAML.load_file(File.join(dir, ent))
       yml = YAML.load_file(File.join(dir, ent))
       if yml
       if yml

+ 12 - 11
webgen/locales/fr.yml

@@ -1,23 +1,24 @@
 ---
 ---
-description: "Outil d'agrandissement de dessins de style anime, employant des réseaux de neurones convolutionnels. Fonctionne aussi sur des photos."
+description: "Outil permettant d'agrandir n'importe quelle image de style \"anime\", par le biais de réseaux de neurones convolutionnels. Fonctionne également sur les photos."
 show_demonstration: "Voir une démonstration"
 show_demonstration: "Voir une démonstration"
 go_to_github: "Aller sur GitHub"
 go_to_github: "Aller sur GitHub"
-image_choosing: "Sélection de l'image"
-type_url: "Entrer un URL"
-choose_file: "Ou utiliser un fichier"
-file_limits: "Limites : Taille : 3MB, Réduction du bruit : 2560x2560px, Agrandissement : 1280x1280px."
-style: "Style"
+image_choosing: "Sélection de l'image "
+type_url: "Entrez une URL"
+choose_file: "Ou choisissez un fichier "
+file_limits: "Limites : Taille : 3 Mo, Réduction du bruit numérique, 2560x2560px, Agrandissement : 1280x1280px."
+style: "Style "
 artwork: "Dessin"
 artwork: "Dessin"
 photo: "Photo"
 photo: "Photo"
-noise_reduction: "Réduction du bruit"
-expect_jpeg: "des artefacts JPEG risquent d'apparaître"
+noise_reduction: "Réduction du bruit numérique "
+expect_jpeg: "des artéfacts JPEG risquent d'apparaître"
 nr_none: "Aucune"
 nr_none: "Aucune"
 nr_medium: "Moyenne"
 nr_medium: "Moyenne"
 nr_high: "Haute"
 nr_high: "Haute"
-nr_hint: "Il est nécessaire d'utiliser la réduction du bruit si l'image possède du bruit. Autrement, cela risque de causer l'effet opposé."
-upscaling: "Agrandissement"
+nr_highest: "Maximale"
+nr_hint: "Il n'est nécessaire d'utiliser cette option qu'en présence de bruit numérique sur l'image. Si ce n'est pas le cas, l'effet obtenu sera contraire à celui recherché."
+upscaling: "Agrandissement "
 up_none: "Aucun"
 up_none: "Aucun"
 button_convert: "Convertir"
 button_convert: "Convertir"
 button_download: "Télécharger"
 button_download: "Télécharger"
 hints:
 hints:
-  - "Si vous utilisez Firefox, utilisez Ctrl+S pour enregistrer l'image. L'option \"Enregistrer l'image\" ne fonctionne pas."
+  - "Note aux utilisateurs de Firefox : L'option \"Enregistrer l'image\" ne fonctionne pas. Merci d'utiliser Ctrl+S pour enregistrer l'image. "

+ 24 - 0
webgen/locales/zh-CN.yml

@@ -0,0 +1,24 @@
+---
+description: 本程序使用卷积神经网络对动漫风格的图片进行放大操作(支持照片)。
+show_demonstration: 完整演示
+go_to_github: 转至GitHub
+image_choosing: 选择图像
+type_url: 输入图像链接
+choose_file: 或者从本地上传
+file_limits: "文件大小不得超过3MB;可降噪图像的最大尺寸:2560x2560px;可放大图像的最大尺寸:1280x1280px。"
+style: 风格
+artwork: 插图
+photo: 照片
+noise_reduction: 降噪程度
+expect_jpeg: 可能会产生JPEG噪点
+nr_none: 不降噪
+nr_medium: 中
+nr_high: 高
+nr_highest: 最高
+nr_hint: "请仅在图像本身含有噪点的情况下使用降噪,否则可能产生反效果。"
+upscaling: 放大倍数
+up_none: 不放大
+button_convert: 转换
+button_download: 下载
+hints:
+  - "Firefox无法用右键菜单中的“保存图像”,请按Ctrl+S保存。"

+ 4 - 0
webgen/templates/index.html.erb

@@ -49,6 +49,10 @@
 	<a href="index.tr.html">
 	<a href="index.tr.html">
 	  Türkçe
 	  Türkçe
 	</a>
 	</a>
+	/
+	<a href="index.zh-CN.html">
+	  简体中文
+	</a>
       </div>
       </div>
       <p><%= t[:description] %></p>
       <p><%= t[:description] %></p>
       <p class="margin1 link-box">
       <p class="margin1 link-box">