Update download_resource.bat
This commit is contained in:
parent
e3a4fd4645
commit
f385eda244
@ -4,9 +4,16 @@ setlocal enabledelayedexpansion
|
|||||||
REM 设置环境变量
|
REM 设置环境变量
|
||||||
set "PROJECT_DIR=%~dp0"
|
set "PROJECT_DIR=%~dp0"
|
||||||
set "PYTHONDONTWRITEBYTECODE=1"
|
set "PYTHONDONTWRITEBYTECODE=1"
|
||||||
set "GDOWN_CACHE=cache\gdown"
|
set "GDOWN_CACHE=%PROJECT_DIR%\cache\gdown"
|
||||||
set "TORCH_HOME=cache\torch"
|
set "TORCH_HOME=%PROJECT_DIR%\cache\torch"
|
||||||
set "HF_HOME=cache\huggingface"
|
set "HF_HOME=%PROJECT_DIR%\cache\huggingface"
|
||||||
|
|
||||||
|
REM 检查 Python
|
||||||
|
python --version >nul 2>&1
|
||||||
|
if %ERRORLEVEL% neq 0 (
|
||||||
|
echo ERROR: Python not found
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
REM 创建缓存目录
|
REM 创建缓存目录
|
||||||
mkdir "%PROJECT_DIR%\cache\gdown" 2>nul
|
mkdir "%PROJECT_DIR%\cache\gdown" 2>nul
|
||||||
@ -22,28 +29,72 @@ mkdir "%PROJECT_DIR%\resource\openpose\models" 2>nul
|
|||||||
mkdir "%PROJECT_DIR%\resource\hyperIQA\pretrained" 2>nul
|
mkdir "%PROJECT_DIR%\resource\hyperIQA\pretrained" 2>nul
|
||||||
|
|
||||||
REM 安装gdown
|
REM 安装gdown
|
||||||
|
python -m pip install --upgrade pip
|
||||||
python -m pip install gdown
|
python -m pip install gdown
|
||||||
|
|
||||||
REM 下载模型文件
|
REM 下载 NeuralHaircut 模型文件
|
||||||
cd "%PROJECT_DIR%\resource\NeuralHaircut"
|
cd "%PROJECT_DIR%\resource\NeuralHaircut"
|
||||||
python -m gdown --folder https://drive.google.com/drive/folders/1TCdJ0CKR3Q6LviovndOkJaKm8S1T9F_8
|
python -m gdown --folder https://drive.google.com/drive/folders/1TCdJ0CKR3Q6LviovndOkJaKm8S1T9F_8
|
||||||
|
if %ERRORLEVEL% neq 0 (
|
||||||
|
echo ERROR: Failed to download NeuralHaircut models
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
cd "%PROJECT_DIR%\resource\NeuralHaircut\pretrained_models\diffusion_prior"
|
cd "%PROJECT_DIR%\resource\NeuralHaircut\pretrained_models\diffusion_prior"
|
||||||
python -m gdown 1_9EOUXHayKiGH5nkrayncln3d6m1uV7f
|
python -m gdown 1_9EOUXHayKiGH5nkrayncln3d6m1uV7f
|
||||||
|
if %ERRORLEVEL% neq 0 (
|
||||||
|
echo ERROR: Failed to download diffusion prior model
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
cd "%PROJECT_DIR%\resource\NeuralHaircut\PIXIE"
|
cd "%PROJECT_DIR%\resource\NeuralHaircut\PIXIE"
|
||||||
python -m gdown 1mPcGu62YPc4MdkT8FFiOCP629xsENHZf
|
python -m gdown 1mPcGu62YPc4MdkT8FFiOCP629xsENHZf
|
||||||
|
if %ERRORLEVEL% neq 0 (
|
||||||
|
echo ERROR: Failed to download PIXIE model
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
REM 下载 hyperIQA 模型文件
|
||||||
cd "%PROJECT_DIR%\resource\hyperIQA\pretrained"
|
cd "%PROJECT_DIR%\resource\hyperIQA\pretrained"
|
||||||
python -m gdown 1OOUmnbvpGea0LIGpIWEbOyxfWx6UCiiE
|
python -m gdown 1OOUmnbvpGea0LIGpIWEbOyxfWx6UCiiE
|
||||||
|
if %ERRORLEVEL% neq 0 (
|
||||||
|
echo ERROR: Failed to download hyperIQA model
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
REM 下载 Matte-Anything 模型文件
|
||||||
cd "%PROJECT_DIR%\resource\Matte-Anything\pretrained"
|
cd "%PROJECT_DIR%\resource\Matte-Anything\pretrained"
|
||||||
curl -L https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -o sam_vit_h_4b8939.pth
|
curl -L https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -o sam_vit_h_4b8939.pth
|
||||||
curl -L https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth -o groundingdino_swint_ogc.pth
|
if %ERRORLEVEL% neq 0 (
|
||||||
python -m gdown 1d97oKuITCeWgai2Tf3iNilt6rMSSYzkW
|
echo ERROR: Failed to download SAM model
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
curl -L https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth -o groundingdino_swint_ogc.pth
|
||||||
|
if %ERRORLEVEL% neq 0 (
|
||||||
|
echo ERROR: Failed to download GroundingDINO model
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
python -m gdown 1d97oKuITCeWgai2Tf3iNilt6rMSSYzkW
|
||||||
|
if %ERRORLEVEL% neq 0 (
|
||||||
|
echo ERROR: Failed to download Matte-Anything model
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
REM 下载 OpenPose 模型文件
|
||||||
cd "%PROJECT_DIR%\resource\openpose"
|
cd "%PROJECT_DIR%\resource\openpose"
|
||||||
python -m gdown 1Yn03cKKfVOq4qXmgBMQD20UMRRRkd_tV
|
python -m gdown 1Yn03cKKfVOq4qXmgBMQD20UMRRRkd_tV
|
||||||
|
if %ERRORLEVEL% neq 0 (
|
||||||
|
echo ERROR: Failed to download OpenPose models
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
tar -xf models.tar.gz
|
tar -xf models.tar.gz
|
||||||
|
if %ERRORLEVEL% neq 0 (
|
||||||
|
echo ERROR: Failed to extract OpenPose models
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
cd "%PROJECT_DIR%"
|
cd "%PROJECT_DIR%"
|
||||||
|
echo All resources downloaded successfully!
|
||||||
|
Loading…
Reference in New Issue
Block a user