Sie können ein Batch-Skript mit dem folgenden Code erstellen:

@echo off

REM Set the path to ImageMagick and the VMAF tool
set IM_PATH=C:\ImageMagick
set VMAF_PATH=C:\vmaf

REM Set the input folder and output folder for images
set INPUT_FOLDER=C:\input
set OUTPUT_FOLDER=C:\output

REM Loop through all the images in the input folder
for /r %INPUT_FOLDER% %%f in (*.jpg) do (
  REM Encode the image to JpegXL with a quality of 93
  %IM_PATH%\convert.exe "%%f" -quality 93 "%OUTPUT_FOLDER%\%%~nf.jpegxl"

  REM Calculate the VMAF score for the image
  %VMAF_PATH%\vmafossexec.exe yuv420p 1920 1080 %OUTPUT_FOLDER%\%%~nf.jpegxl %OUTPUT_FOLDER%\%%~nf.jpegxl > "%OUTPUT_FOLDER%\vmaf-scores.txt"

  REM Read the VMAF score from the text file
  for /f "tokens=2 delims=:" %%g in ('findstr /c:"VMAF score" "%OUTPUT_FOLDER%\vmaf-scores.txt"') do set score=%%g

  REM Check if the VMAF score is below 90
  if %score% LSS 90 (
    REM Encode the image to JpegXL with a quality of 97
    %IM_PATH%\convert.exe "%%f" -quality 97 "%OUTPUT_FOLDER%\%%~nf.jpegxl"

    REM Calculate the VMAF score for the image again
    %VMAF_PATH%\vmafossexec.exe yuv420p 1920 1080 %OUTPUT_FOLDER%\%%~nf.jpegxl %OUTPUT_FOLDER%\%%~nf.jpegxl > "%OUTPUT_FOLDER%\vmaf-scores-new.txt"

    REM Read the VMAF score from the text file again
    for /f "tokens=2 delims=:" %%g in ('findstr /c:"VMAF score" "%OUTPUT_FOLDER%\vmaf-scores-new.txt"') do set new_score=%%g

    REM Check if the VMAF score is still below 90
    if %new_score% LSS 90 (
      REM Shut down the computer
      shutdown /s /t 0
    )
  )
)

Bitte beachten Sie, dass Sie die Pfade zu ImageMagick und VMAF entsprechend Ihrer Installation anpassen müssen. Außerdem müssen Sie die Größe des Bildes und die gewünschte Ausgabequalität angeben.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence