Skip to content

Commit

Permalink
Fixed an upstream problem XPixelGroup/BasicSR#667
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyWolf13 committed May 31, 2024
1 parent 2f41341 commit 49d6233
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion gfpgan_auto-installer.bat
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,27 @@ echo echo Downloading model 1.4
echo set model_link^=https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.pth
echo set /p model_link^="If you want to download another model, paste the link here, otherwise press [ENTER]: "
echo wget %%model_link%% -P experiments/pretrained_models

echo set "filepath=%localappdata%\Programs\Python\Python310\Lib\site-packages\basicsr\data\degradations.py"
echo set "tempfile=%localappdata%\Programs\Python\Python310\Lib\site-packages\basicsr\data\degradations_temp.py"
echo if not exist "%filepath%" (
echo echo File not found: %filepath%
echo exit /b 1
echo )
echo set /a counter=0
echo for /f "delims=" %%i in ('findstr /n "^" "%filepath%"') do (
echo set /a counter+=1
echo if !counter! equ 8 (
echo echo from torchvision.transforms.functional import rgb_to_grayscale>>"%tempfile%"
echo ) else (
echo echo %%i>>"%tempfile%"
echo )
echo )
echo move /y "%tempfile%" "%filepath%"




echo del "%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\autostart_gfpgan.bat"
echo.
echo cd ..
Expand Down Expand Up @@ -185,4 +206,4 @@ echo Cleaning up...
del preinstall.bat
del starter.bat
del install.bat
exit
exit

0 comments on commit 49d6233

Please sign in to comment.