|
|

楼主 |
发表于 2025-6-20 23:30:10
|
显示全部楼层
想起来一点,好像是修改batch目录下bat文件,修改内存占用什么的, 该改哪个数据大神帮一下忙?下面是TG12Xa2.bat里的数据
@echo off
chcp 65001>nul
echo.
rem TecoGAN(tg16x_z.exe)を使用して8倍動画超解像を行う
rem 8x video super-resolution using TecoGAN(tg16x_z.exe).
rem OPTION------------------------------------------------------------------------------------------
rem 対応するJavPlayerのバージョン(互換性チェック用)
rem Target JavPlayer version (for compatibility check)
::JP_VER 300
rem 出力画像のズレ補正(右および下にずらすピクセル数)
rem Correction of output image misalignment (Number of pixels to shift right and down).
::SHIFT_X 0
::SHIFT_Y 0
rem ツールのために確保するVRAM容量(単位MB) = VRAM_USAGE + VRAM_USAGE_P*入力画像のピクセル数/10000
rem 並列実行を管理するために使用される
rem VRAM space to be reserved for this tool (Unit:MB) = VRAM_USAGE + VRAM_USAGE_P*[Number of pixels in the input image]/10000
rem Used to manage parallel execution.
::VRAM_USAGE 400
::VRAM_USAGE_P 3500
rem ツールのために確保するメインメモリ容量(単位MB) = MEM_USAGE + MEM_USAGE_P*入力画像のピクセル数/10000
rem 並列実行を管理するために使用される
rem MainMemory space to be reserved for this tool (Unit:MB) = MEM_USAGE + MEM_USAGE_P*[Number of pixels in the input image]/10000
rem Used to manage parallel execution.
::MEM_USAGE 600
::MEM_USAGE_P 200
rem ARGUMENTS---------------------------------------------------------------------------------------
rem 引数1(%1)は当該ツールフォルダのパス
rem argument1(%1) is the path of the relevant tool folder.
rem 引数2(%2)はワークフォルダのパス
rem argument2(%2) is the path of the wook folder.
rem 引数3(%3)は入力画像フォルダ名
rem argument3(%3) is the input folder name.
rem 引数4(%4)は出力画像フォルダ名
rem argument4(%4) is the output folder name.
rem 引数5(%5)は使用するモデルの種別(STD,AF1,etc.)
rem argument5(%5) is the type of model to use (STD,AF1,etc.)
rem 引数6(%6)は使用するGPUの番号(0<=GPUID<=3,7:CPU)
rem argument6(%6) is the ID of the GPU to use (0<=GPUID<=3,7:CPU)
rem 引数7(%7)はプロセスに割り当てられたVRAMの容量(MB)
rem argument7(%7) is VRAM capacity allocated to this process
rem 引数8(%8)はVRAMの総容量(MB)
rem argument8(%8) is total VRAM capacity
rem 引数9(%9)はポーズコマンド(エラーチェックモードの場合のみ"pause"で、通常は"")
rem argument9(%9) is the pause command. ("pause" only in error-checking mode, normally "")
rem PROCESS-----------------------------------------------------------------------------------------
rem 使用モデルを選択
rem Select a model to use.
if %5==STD (
set tg_model=TG12X_std_cth7_107k@7t.pth
) else (
set tg_model=TG12X_afl_cth4_101k@7t.pth
)
echo tg_model=%tg_model%
rem VRAM使用割合の上限を決定
rem Determine the upper limit of the VRAM usage percentage.
set /a vram_fraction=%7*100
set /a vram_fraction/=%8
if %vram_fraction% lss 100 (
set /a vram_fraction+=1
)
cd /d %2
rem 超解像処理を実行
rem エラーが発生したら途中から再開
rem Execute super-resolution processing.
rem If an error occurs, resume from the middle of the process.
set /a resume=0
set /a num_in=0
for %%A in (%1\*.png) do (if exist %%A (set /a num_in+=1))
set /a num_out=0
set order=both
:run
@echo on
"%~1\python" "%~1\tg.py" %3 %4 %num_out% models\%tg_model% %6 %vram_fraction% %order% jpg
%9
@echo off
set /a num_out=0
for %%A in (%2\*.jpg) do (if exist %%A (set /a num_out+=1))
if %num_out% geq %num_in% goto :exit
if exist %2tmp set order=reverse
set /a resume+=1
if %resume% leq 9 goto :run
:exit |
|