diff --git a/style-transform-master/.vs/style-transform-master/v16/.suo b/style-transform-master/.vs/style-transform-master/v16/.suo index b607672..ddaa91e 100644 Binary files a/style-transform-master/.vs/style-transform-master/v16/.suo and b/style-transform-master/.vs/style-transform-master/v16/.suo differ diff --git a/style-transform-master/style-transform-master/html/index.html b/style-transform-master/style-transform-master/html/index.html index f8cda23..fc2bffb 100644 --- a/style-transform-master/style-transform-master/html/index.html +++ b/style-transform-master/style-transform-master/html/index.html @@ -161,15 +161,12 @@

START HERE

- We love feedback. Fill out - the form below and we'll get back to you as soon as possible. in minus distinctio dolores ipsam. + 请选择内容图片、风格图片、训练轮数(不超过2000的正整数)。

- -
diff --git a/style-transform-master/style-transform-master/html/invalidParam.html b/style-transform-master/style-transform-master/html/invalidParam.html new file mode 100644 index 0000000..89d966e --- /dev/null +++ b/style-transform-master/style-transform-master/html/invalidParam.html @@ -0,0 +1,14 @@ + + + + + + Error + + + + + \ No newline at end of file diff --git a/style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsprojAssemblyReference.cache b/style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsprojAssemblyReference.cache index 80efde4..7312928 100644 Binary files a/style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsprojAssemblyReference.cache and b/style-transform-master/style-transform-master/obj/Debug/style-transform-master.njsprojAssemblyReference.cache differ diff --git a/style-transform-master/style-transform-master/public/uploads/6be77319ed4f40cb3764c9d17a0e3e6d b/style-transform-master/style-transform-master/public/uploads/0b9e1f6ea0eec93b0e95489ede81efe9 similarity index 100% rename from style-transform-master/style-transform-master/public/uploads/6be77319ed4f40cb3764c9d17a0e3e6d rename to style-transform-master/style-transform-master/public/uploads/0b9e1f6ea0eec93b0e95489ede81efe9 diff --git a/style-transform-master/style-transform-master/public/uploads/176b3478124094634bb8c1aceda8d75ea236a21175a.jpg b/style-transform-master/style-transform-master/public/uploads/176b3478124094634bb8c1aceda8d75ea236a21175a.jpg deleted file mode 100644 index 6b9e816..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/176b3478124094634bb8c1aceda8d75ea236a21175a.jpg and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/176b348fcce3fc160596c09a98cbe47ee2a086c42bd.jpg b/style-transform-master/style-transform-master/public/uploads/176b348fcce3fc160596c09a98cbe47ee2a086c42bd.jpg deleted file mode 100644 index ec2b2c1..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/176b348fcce3fc160596c09a98cbe47ee2a086c42bd.jpg and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/176b34907171b5597171b2e24a6430897b21314cf27.jpg b/style-transform-master/style-transform-master/public/uploads/176b34907171b5597171b2e24a6430897b21314cf27.jpg deleted file mode 100644 index 79b5cdb..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/176b34907171b5597171b2e24a6430897b21314cf27.jpg and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/176b62ef69c4504039867a3f22459b274ae77a5a606.jpg b/style-transform-master/style-transform-master/public/uploads/176b62ef69c4504039867a3f22459b274ae77a5a606.jpg new file mode 100644 index 0000000..b128a64 Binary files /dev/null and b/style-transform-master/style-transform-master/public/uploads/176b62ef69c4504039867a3f22459b274ae77a5a606.jpg differ diff --git a/style-transform-master/style-transform-master/public/uploads/176b62eff03da3fa8f3183c02663d14ec6478fcf1b4.jpg b/style-transform-master/style-transform-master/public/uploads/176b62eff03da3fa8f3183c02663d14ec6478fcf1b4.jpg new file mode 100644 index 0000000..9d6580b Binary files /dev/null and b/style-transform-master/style-transform-master/public/uploads/176b62eff03da3fa8f3183c02663d14ec6478fcf1b4.jpg differ diff --git a/style-transform-master/style-transform-master/public/uploads/176b344f40c982f6168b63a0165c869a89be89c8537.jpg b/style-transform-master/style-transform-master/public/uploads/176b62f08e950bdb22703fd224699f89a11f22b9a51.jpg similarity index 100% rename from style-transform-master/style-transform-master/public/uploads/176b344f40c982f6168b63a0165c869a89be89c8537.jpg rename to style-transform-master/style-transform-master/public/uploads/176b62f08e950bdb22703fd224699f89a11f22b9a51.jpg diff --git a/style-transform-master/style-transform-master/public/uploads/31cb74097c0f137cda202f97fc82c39c b/style-transform-master/style-transform-master/public/uploads/31cb74097c0f137cda202f97fc82c39c deleted file mode 100644 index e9fce34..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/31cb74097c0f137cda202f97fc82c39c and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/a0e8ff26bdf39d016052c3338fd11ab9 b/style-transform-master/style-transform-master/public/uploads/4174dad3fa965a41812ef3e270ebed52 similarity index 100% rename from style-transform-master/style-transform-master/public/uploads/a0e8ff26bdf39d016052c3338fd11ab9 rename to style-transform-master/style-transform-master/public/uploads/4174dad3fa965a41812ef3e270ebed52 diff --git a/style-transform-master/style-transform-master/public/uploads/4a528c2b3d548f21efd498d6fcc6ee3e b/style-transform-master/style-transform-master/public/uploads/4a528c2b3d548f21efd498d6fcc6ee3e deleted file mode 100644 index e9fce34..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/4a528c2b3d548f21efd498d6fcc6ee3e and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/24140d7a8f001e552893569e61c45022 b/style-transform-master/style-transform-master/public/uploads/5916e283b8605d7eb9abb6f300979d86 similarity index 100% rename from style-transform-master/style-transform-master/public/uploads/24140d7a8f001e552893569e61c45022 rename to style-transform-master/style-transform-master/public/uploads/5916e283b8605d7eb9abb6f300979d86 diff --git a/style-transform-master/style-transform-master/public/uploads/f8abae0975cdc75a23d08fdf7c22b90c b/style-transform-master/style-transform-master/public/uploads/5afecf4af2d51997c1ef512ca938e049 similarity index 100% rename from style-transform-master/style-transform-master/public/uploads/f8abae0975cdc75a23d08fdf7c22b90c rename to style-transform-master/style-transform-master/public/uploads/5afecf4af2d51997c1ef512ca938e049 diff --git a/style-transform-master/style-transform-master/public/uploads/5d12f10fc144097bef3ce8d7227800cf b/style-transform-master/style-transform-master/public/uploads/5d12f10fc144097bef3ce8d7227800cf new file mode 100644 index 0000000..2b6f2b0 Binary files /dev/null and b/style-transform-master/style-transform-master/public/uploads/5d12f10fc144097bef3ce8d7227800cf differ diff --git a/style-transform-master/style-transform-master/public/uploads/7b5ee265b28a6127e1655142523c6ce4 b/style-transform-master/style-transform-master/public/uploads/7b5ee265b28a6127e1655142523c6ce4 deleted file mode 100644 index e9fce34..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/7b5ee265b28a6127e1655142523c6ce4 and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/8d3e625b6df9503dd5e7edd271165c38 b/style-transform-master/style-transform-master/public/uploads/8d3e625b6df9503dd5e7edd271165c38 new file mode 100644 index 0000000..2b6f2b0 Binary files /dev/null and b/style-transform-master/style-transform-master/public/uploads/8d3e625b6df9503dd5e7edd271165c38 differ diff --git a/style-transform-master/style-transform-master/public/uploads/9529e38e01e4ade24d1939ae029ea7ba b/style-transform-master/style-transform-master/public/uploads/9529e38e01e4ade24d1939ae029ea7ba deleted file mode 100644 index dd27b85..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/9529e38e01e4ade24d1939ae029ea7ba and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/a66b7d24b2ae85efd87692b33e8e69d1 b/style-transform-master/style-transform-master/public/uploads/a66b7d24b2ae85efd87692b33e8e69d1 deleted file mode 100644 index dd27b85..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/a66b7d24b2ae85efd87692b33e8e69d1 and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/248baa6862e643126e7cc271f5c0db43 b/style-transform-master/style-transform-master/public/uploads/a8cdf543e7ed700c2820fbc9b84458ff similarity index 100% rename from style-transform-master/style-transform-master/public/uploads/248baa6862e643126e7cc271f5c0db43 rename to style-transform-master/style-transform-master/public/uploads/a8cdf543e7ed700c2820fbc9b84458ff diff --git a/style-transform-master/style-transform-master/public/uploads/b68ae966a5ac0ce4ef5c59feff613a2e b/style-transform-master/style-transform-master/public/uploads/b68ae966a5ac0ce4ef5c59feff613a2e deleted file mode 100644 index dd27b85..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/b68ae966a5ac0ce4ef5c59feff613a2e and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/c0c0d564976eb7c53c1436be2333f31e b/style-transform-master/style-transform-master/public/uploads/c0c0d564976eb7c53c1436be2333f31e deleted file mode 100644 index e9fce34..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/c0c0d564976eb7c53c1436be2333f31e and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/caa0e5cfcb3f4597e4c0ed7790275f31 b/style-transform-master/style-transform-master/public/uploads/caa0e5cfcb3f4597e4c0ed7790275f31 deleted file mode 100644 index e9fce34..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/caa0e5cfcb3f4597e4c0ed7790275f31 and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/ce4073057a801b2ca993fb1469a15e99 b/style-transform-master/style-transform-master/public/uploads/ce4073057a801b2ca993fb1469a15e99 deleted file mode 100644 index e9fce34..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/ce4073057a801b2ca993fb1469a15e99 and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/d6a0e417d27ad4937da8f0ce7a826fd4 b/style-transform-master/style-transform-master/public/uploads/d6a0e417d27ad4937da8f0ce7a826fd4 deleted file mode 100644 index e9fce34..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/d6a0e417d27ad4937da8f0ce7a826fd4 and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/e634459ff4fd2d759b4691375f922723 b/style-transform-master/style-transform-master/public/uploads/e634459ff4fd2d759b4691375f922723 deleted file mode 100644 index dd27b85..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/e634459ff4fd2d759b4691375f922723 and /dev/null differ diff --git a/style-transform-master/style-transform-master/public/uploads/40bf7fff77f209858c92692c1643db05 b/style-transform-master/style-transform-master/public/uploads/fb3657ced22b1a0053d4c5aa897b838b similarity index 100% rename from style-transform-master/style-transform-master/public/uploads/40bf7fff77f209858c92692c1643db05 rename to style-transform-master/style-transform-master/public/uploads/fb3657ced22b1a0053d4c5aa897b838b diff --git a/style-transform-master/style-transform-master/public/uploads/fe5269e79229d462114741c0ffadf28a b/style-transform-master/style-transform-master/public/uploads/fe5269e79229d462114741c0ffadf28a deleted file mode 100644 index dd27b85..0000000 Binary files a/style-transform-master/style-transform-master/public/uploads/fe5269e79229d462114741c0ffadf28a and /dev/null differ diff --git a/style-transform-master/style-transform-master/server.js b/style-transform-master/style-transform-master/server.js index 4ca1be4..40a69c8 100644 --- a/style-transform-master/style-transform-master/server.js +++ b/style-transform-master/style-transform-master/server.js @@ -83,20 +83,23 @@ function run_child(taskID) { } server.post('/generate', upload.fields([{ name: 'content_image', maxCount: 1 }, { name: 'style_image', maxCount: 1 }]), function (req, res) { - let max_epoch = req.body.max_epoch; + let max_epoch = parseInt(req.body.max_epoch || "100"); let md5 = crypto.createHash('md5'); console.log(req.files); console.log("Epoch = " + max_epoch); - if (!req.files.content_image || !req.files.style_image) { - progress[taskID] = {percentage: 0, max_epoch: 0, status: -2}; + if (max_epoch > 2000 || max_epoch <= 0 || !req.files.content_image || !req.files.style_image) { + res.writeHead(444, { 'Content-type': 'text/html' }); + res.end(fs.readFileSync("./html/invalidParam.html")); + return; } + let taskID = Date.now().toString(16) + md5.update(req.files.content_image[0].filename + req.files.style_image[0].filename).digest('hex'); relationfile[taskID] = {content: req.files.content_image[0].filename, style: req.files.style_image[0].filename}; - progress[taskID] = {percentage: 0, max_epoch: parseInt(max_epoch), status: 0, wait: totalTask + queue.length + 1}; + progress[taskID] = {percentage: 0, max_epoch: max_epoch, status: 0, wait: totalTask + queue.length + 1}; if (isIdle) { isIdle = false; diff --git a/style-transform-master/style-transform-master/style-transform-master.njsproj b/style-transform-master/style-transform-master/style-transform-master.njsproj index 5dfde67..860c1d0 100644 --- a/style-transform-master/style-transform-master/style-transform-master.njsproj +++ b/style-transform-master/style-transform-master/style-transform-master.njsproj @@ -33,6 +33,9 @@ + + Code + Code