The following Windows batch script will create a subdirectory named subset in the working directory where it's called, and then copy every Nth file from the working directory into the subdirectory.
This is useful if you want to create a faceset from an extraction with a low Extract Every N setting (usually EEN=1 if you're using that video for conversion later). Instead of re-extracting those faces with FaceSwap at a higher EEN, you can use the following (Windows) script to copy 1 every N files into a subdirectory.
In the example below, the script lives here:
Code: Select all
C:\swaps\extractions\every.bat
When you call the script, you must provide a number for N. For example:
Code: Select all
.\every 10
Code: Select all
@ECHO off
SETLOCAL EnableDelayedExpansion
SET /A every = %1
SET /A index = 0
SET /A files = 0
SET /A count = 0
MKDIR subset
ECHO Making a copy every %every% files...
FOR %%G IN (*) DO (
SET /A files += 1
SET /A index += 1
IF !index! EQU %every% (
@COPY "%%G" .\subset 1>NUL
SET /A count += 1
SET /A index = 0
)
)
ECHO Copied %count%/%files% files.
ENDLOCAL