Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pareto Principle Way #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ Other recommended projects:<br>
realesrgan-ncnn-vulkan.exe -i input.jpg -o output.png -n realesr-animevideov3 -s 2
```

### Pareto Principle Way

with the ``DragAndDropFolderScale.bat`` you can quickly scale up whole folders on a windows system.

you just grab the folder📂 and drag it to the script⚙️ and it asks you in 2 steps what you want.

### Full Usages

```console
Expand Down
75 changes: 75 additions & 0 deletions batchhelper/DragAndDropFolderScale.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@echo off
setlocal

rem Verify that a folder was passed by drag and drop
if "%~1"=="" (
echo Please drag a folder on the script.
pause
exit /b
)

rem Determine the path to the executable file
set "executable_path=%~dp0realesrgan-ncnn-vulkan.exe"

rem Check if the executable file exists
if not exist "%executable_path%" (
echo The executable file was not found: %executable_path%
echo DragAndDropFolderScale.bat script must be located next to the exe in the folder for this to work
echo.
echo +--- README_windows.md
echo +--- DragAndDropFolderScale.bat
echo +--- realesrgan-ncnn-vulkan.exe
echo +--- models
echo +--- realesr-animevideov3-x2.bin
echo +--- realesr-animevideov3-x2.param
echo +--- realesrgan-x4plus.bin
echo \--- ...
echo +--- vcomp140.dll
echo \--- vcomp140d.dll
echo.
echo ===============================
echo :::: Download ::::
echo https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan
echo.
pause
exit /b
)

rem To select model
echo Please select a model:
echo 1 - realesr-animevideov3
echo 2 - realesrgan-x4plus
echo 3 - realesrgan-x4plus-anime
echo 4 - realesrnet-x4plus

choice /C 1234 /N

if errorlevel 4 (
set "model=realesrnet-x4plus"
) else if errorlevel 3 (
set "model=realesrgan-x4plus-anime"
) else if errorlevel 2 (
set "model=realesrgan-x4plus"
) else (
set "model=realesr-animevideov3"
)

:again
echo Please enter upscale ratio number (can be 2, 3, 4)
set /p number=
if not defined number goto again

rem Change to the directory of the passed folder
cd /d "%~dp1"

rem Create the new folder with the suffix "_scale"
mkdir "%~n1_%model%_scale_%number%"

rem Saving the folder path
set "folder_path=%~dp1%~n1_%model%_scale_%number%"

rem run "realesrgan-ncnn-vulkan.exe" with the parameters
"%executable_path%" -i "%~dp1%~n1" -o "%folder_path%" -n %model% -s %number%

endlocal
exit