Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 49d6233

Browse files
authored
Fixed an upstream problem XPixelGroup/BasicSR#667
1 parent 2f41341 commit 49d6233

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

gfpgan_auto-installer.bat

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,27 @@ echo echo Downloading model 1.4
147147
echo set model_link^=https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.pth
148148
echo set /p model_link^="If you want to download another model, paste the link here, otherwise press [ENTER]: "
149149
echo wget %%model_link%% -P experiments/pretrained_models
150+
151+
echo set "filepath=%localappdata%\Programs\Python\Python310\Lib\site-packages\basicsr\data\degradations.py"
152+
echo set "tempfile=%localappdata%\Programs\Python\Python310\Lib\site-packages\basicsr\data\degradations_temp.py"
153+
echo if not exist "%filepath%" (
154+
echo echo File not found: %filepath%
155+
echo exit /b 1
156+
echo )
157+
echo set /a counter=0
158+
echo for /f "delims=" %%i in ('findstr /n "^" "%filepath%"') do (
159+
echo set /a counter+=1
160+
echo if !counter! equ 8 (
161+
echo echo from torchvision.transforms.functional import rgb_to_grayscale>>"%tempfile%"
162+
echo ) else (
163+
echo echo %%i>>"%tempfile%"
164+
echo )
165+
echo )
166+
echo move /y "%tempfile%" "%filepath%"
167+
168+
169+
170+
150171
echo del "%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\autostart_gfpgan.bat"
151172
echo.
152173
echo cd ..
@@ -185,4 +206,4 @@ echo Cleaning up...
185206
del preinstall.bat
186207
del starter.bat
187208
del install.bat
188-
exit
209+
exit

0 commit comments

Comments
 (0)