diff --git a/package.json b/package.json index a5a5235..7e66cb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moephoto", - "version": "4.5.2", + "version": "4.5.4", "description": "MoePhoto Image Toolbox萌图工具箱 一个基于深度学习的AI图像修复软件(更新中...) 感兴趣的加QQ群320785467讨论 ### 基本功能 * 图像降噪 * 超分辨率 * 去雾 * 涂抹及风格化", "private": true, "directories": { diff --git a/python/video.py b/python/video.py index 32092e9..be6d274 100644 --- a/python/video.py +++ b/python/video.py @@ -105,26 +105,17 @@ def prepare(video, steps): width = optDecode['width'] if 'height' in optDecode: height = optDecode['height'] - scaleW = scaleH = 1 outWidth, outHeight = (width, height) for opt in filter((lambda opt: opt['op'] == 'SR' or opt['op'] == 'resize'), procSteps): if opt['op'] == 'SR': - scaleW *= opt['scale'] - scaleH *= opt['scale'] - else: - if 'scaleW' in opt: - scaleW = opt['scaleW'] - else: - scaleW = 1 - outWidth = opt['width'] - if 'scaleH' in opt: - scaleH = opt['scaleH'] - else: - scaleH = 1 - outHeight = opt['height'] + outWidth *= opt['scale'] + outHeight *= opt['scale'] + else: # resize + outWidth = round(outWidth * opt['scaleW']) if 'scaleW' in opt else opt['width'] + outHeight = round(outHeight * opt['scaleH']) if 'scaleH' in opt else opt['height'] if start < 0: start = 0 - if start and len(slomos): + if start and len(slomos): # should generate intermediate frames between start-1 and start start -= 1 for opt in slomos: opt['opt'].firstTime = 0 @@ -157,7 +148,7 @@ def prepare(video, steps): '-y', '-f', 'rawvideo', '-pix_fmt', pix_fmt, - '-s', '{}x{}'.format(outWidth * scaleW, outHeight * scaleH), + '-s', '{}x{}'.format(outWidth, outHeight), '-r', str(frameRate), '-i', '-', '-i', video, diff --git a/server.bat b/server.bat new file mode 100644 index 0000000..d90fd47 --- /dev/null +++ b/server.bat @@ -0,0 +1,6 @@ +@echo off +setlocal +%~d0 +cd %~dp0 +ipconfig +MoePhoto.exe -g \ No newline at end of file diff --git a/src/js/main.js b/src/js/main.js index e19f3ba..385823c 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -152,7 +152,8 @@ const panels = { values: [ { value: 'scale', binds: ['scaleW'] }, { value: 'pixel', binds: ['width'], checked: 1 } - ] + ], + notes: ['按比例缩放图像长宽的小数部分四舍五入为整数'] }, scaleW: { type: 'number', diff --git a/templates/1-header.html b/templates/1-header.html index 8d6bbd8..b1f3060 100644 --- a/templates/1-header.html +++ b/templates/1-header.html @@ -34,6 +34,9 @@