Skip to content

Commit

Permalink
roop Neuro
Browse files Browse the repository at this point in the history
  • Loading branch information
Shedou committed Aug 1, 2023
1 parent 4efbf39 commit ccdbfb2
Show file tree
Hide file tree
Showing 7 changed files with 338 additions and 0 deletions.
99 changes: 99 additions & 0 deletions roop_Neuro/Commands.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
Additional command line arguments are given below. To learn out what they do, check the guide here.
https://github.com/s0md3v/roop/wiki/3.-Advanced-Options

options:
-h, --help show this help message and exit
-s SOURCE_PATH, --source SOURCE_PATH select an source image
-t TARGET_PATH, --target TARGET_PATH select an target image or video
-o OUTPUT_PATH, --output OUTPUT_PATH select output file or directory
--frame-processor FRAME_PROCESSOR [FRAME_PROCESSOR ...] frame processors (choices: face_swapper, face_enhancer, ...)
--keep-fps keep target fps
--keep-frames keep temporary frames
--skip-audio skip target audio
--many-faces process every face
--reference-face-position REFERENCE_FACE_POSITION position of the reference face
--reference-frame-number REFERENCE_FRAME_NUMBER number of the reference frame
--similar-face-distance SIMILAR_FACE_DISTANCE face distance used for recognition
--temp-frame-format {jpg,png} image format used for frame extraction
--temp-frame-quality [0-100] image quality used for frame extraction
--output-video-encoder {libx264,libx265,libvpx-vp9,h264_nvenc,hevc_nvenc} encoder used for the output video
--output-video-quality [0-100] quality used for the output video
--max-memory MAX_MEMORY maximum amount of RAM in GB
--execution-provider {cpu} [{cpu} ...] available execution provider (choices: cpu, ...)
--execution-threads EXECUTION_THREADS number of execution threads
-v, --version show program's version number and exit

Using the -s/--source, -t/--target and -o/--output argument will run the program in headless mode.

--------------------Advanced-Options--------------------

--- Using Acceleration ---
option: --execution-provider
default: cpu

Depending on what onnxruntime package you installed, specify the respective execution provider with this option to utilize your GPU. Below is a list of popular execution providers, the complete list can be found here. If you are not sure, use the --help option to see the available providers in your console.

cuda: for NVIDIA
rocm: for AMD (linux only)
dml: for windows
coreml: for mac


--- Choosing a frame processor ---
option: --frame-processor
default: face_swapper

This option lets you choose one or more "frame processor" that apply various affect to the video. If you are using multiple processors, they should be separated by spaces. Following frame processors are available:

face_swapper: swaps face(s)
face_enhancer: enhances the face(s) using GFPGAN v1.4


--- Preserving video's FPS ---
option: --keep-fps
default: False

roop reduces the FPS of the video to 30 by default for faster processing but if you would like to preserve the original FPS, you can use this switch.


--- Keep generated frames ---
option: --keep-frames
default: False

While processing a video, roop extracts all of its frames and stores them locally. The directory containing them is deleted once the process has been finished. Using --keep-frames switch will prevent deletion.


--- Replace all faces ---
option: --many-faces
default: False

By default, only one face is replaced in each frame that too the leftmost face in the frame. If you want to replace all of the faces, use this switch.


--- Choose a video encoder ---
option: --video-encoder
default: libx264

This lets you choose a video encoder, currently available encoders are: libx264, libx265, libvpx-vp9`


--- Set video quality ---
option: --video-quality
default: 18

You wouldn't need to touch this option but in case you do, it accepts an number from 1 to 51.


--- Limit RAM ---
option: --max-memory
default: None

If you want to limit how much RAM roop can use, use this option. It accepts a number e.g. --max-memory 4 means 4GB limit.


--- Execution Threads ---
option: --execution-threads
default: system dependent

This control how many threads should run in parallel to process the frames using the given execution provider. Play around with different values to find out what works best on your system.

56 changes: 56 additions & 0 deletions roop_Neuro/Commands_accel.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

https://github.com/s0md3v/roop/wiki/2.-Acceleration
Some things have been fixed.


------ CUDA Execution Provider (Nvidia) ------
Install CUDA Toolkit 11.8
https://developer.nvidia.com/cuda-11-8-0-download-archive

Install dependencies:
pip uninstall onnxruntime onnxruntime-gpu
pip install onnxruntime-gpu==1.15.1

Usage in case the provider is available:
python run.py --execution-provider cuda


------ CoreML Execution Provider (Apple Silicon) ------

Install dependencies:
pip uninstall onnxruntime onnxruntime-silicon
pip install onnxruntime-silicon==1.13.1

Usage in case the provider is available:
python run.py --execution-provider coreml


------ CoreML Execution Provider (Apple Legacy) ------

Install dependencies:
pip uninstall onnxruntime onnxruntime-coreml
pip install onnxruntime-coreml==1.13.1

Usage in case the provider is available:
python run.py --execution-provider coreml


------ DirectML Execution Provider (Windows) ------

Install dependencies:
pip uninstall onnxruntime onnxruntime-directml
pip install onnxruntime-directml==1.15.1

Usage in case the provider is available:
python run.py --execution-provider dml


------ OpenVINO™ Execution Provider (Intel) ------
Install dependencies:
pip uninstall onnxruntime onnxruntime-openvino
pip install onnxruntime-openvino==1.15.0

Usage in case the provider is available:
python run.py --execution-provider openvino


32 changes: 32 additions & 0 deletions roop_Neuro/Debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@echo off

::::::::::: Setting variables, please do not change unless you understand what you are doing!

set DIR=%~dp0Depends
set PATH=C:\Windows\system32;C:\Windows;%DIR%\git\bin;%DIR%\python310;%DIR%\python310\Scripts;%DIR%\ffmpeg-6.0-full_build-shared\bin
set TRANSFORMERS_CACHE=%DIR%\transformers-cache

set GIT_SSL_NO_VERIFY=true





::::::::::: Uncomment the examples and modify as you wish.


:::::: Install/Uninstall Python modules, see file "Commands_accel.txt".
: python -m pip install onnxruntime-directml==1.15.1
: python -m pip uninstall onnxruntime onnxruntime-directml


:::::: Go to the folder "roop" and run the program, see file "Commands.txt".
: cd roop\
: python run.py --execution-provider dml





ECHO Edit this file if needed.
pause
47 changes: 47 additions & 0 deletions roop_Neuro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Сборка roop Neuro
## Пожалуйста, воздержитесь от использования любых файлов и информации из репозитория если вы не готовы взять ответственность за любые возможные и невозможные последствия!
## Внимание! Нейросеть может создавать неприемлемые результаты в зависимости от действий пользователя!
## Описание
Предварительно скомпилированная, портативная сборка приложения roop, данная нейронная сеть позволяет заменять лица на видеозаписях таким образом создавая дипфейки (Deep Fakes), практической пользы я не вижу от данной нейронной сети, но повеселиться в кругу друзей вполне возможно.

Оригинальное описание:

Take a video and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training.

## Установка roop Neuro
### [Скачать roop Neuro](https://github.com/Shedou/Neuro/releases/tag/roop_v1) и распаковать архиватором [7-Zip](https://7-zip.org/).

## Системные требования
<details>
<summary>Системные требования</summary>

___
**Минимальные системные требования:**\
ОС: 64 разрядная Microsoft Windows 10 / 11.\
ЦП: 64 разрядный процессор, 2 ядра.\
ОЗУ: 16 ГБ и больше.\

**Рекомендуемые системные требования:**\
ОС: 64 разрядная Microsoft Windows 10 / 11.\
ЦП: AMD Ryzen 7 2700 / Intel Core i7-9700 или лучше.\
ОЗУ: 64 ГБ.\
Видеокарта: GeForce GTX 1070 / Radeon RX 5700 или лучше.\
Видеопамять: 8 ГБ.
___

</details>

## Использование
- **Start.bat** - Обычный запуск.
- **Start - DirectML.bat** - Использовать GPU для работы.

### Сборка основана на roop v1.3.1:
Репозиторий **[s0md3v/roop](https://github.com/s0md3v/roop).**
## Блог Overclockers
### [overclockers.ru/blog/Hard-Workshop](https://overclockers.ru/blog/Hard-Workshop)

Python:\
https://github.com/adang1345/PythonWin7

ffmpeg-6.0-full_build-shared:\
https://www.gyan.dev/ffmpeg/builds/
70 changes: 70 additions & 0 deletions roop_Neuro/ReadMe! Neuro.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
roop Neuro

Сборка создана для упрощения запуска и использования приложения roop.

Пожалуйста, воздержитесь от использования данной сборки если вы не готовы взять ответственность за любые возможные и невозможные последствия!
Внимание! Нейросеть может создавать неприемлемые результаты в зависимости от действий пользователя!

- Описание:
Take a video and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training.

..........................................................
..........................................................

- Установка:
Распаковать и использовать.

- Использование:
Start.bat Обычный запуск.
Start - DirectML.bat Использовать GPU для работы.

..........................................................
..........................................................
..........................................................
..........................................................
- Минимальные системные требования:
ОС: 64 разрядная Microsoft Windows 10 / 11.
ЦП: 64 разрядный процессор, 2 ядра.
ОЗУ: 16 ГБ и больше.
..........................................................
- Рекомендуемые системные требования:
ОС: 64 разрядная Microsoft Windows 10 / 11.
ЦП: AMD Ryzen 7 2700 / Intel Core i7-9700 или лучше.
ОЗУ: 64 ГБ.
Видеокарта: GeForce GTX 1070 / Radeon RX 5700 или лучше.
Видеопамять: 8 ГБ.
..........................................................
..........................................................
..........................................................
..........................................................

Работа над сборкой: Chimbal(Shedou).

- Репозиторий с полезными сборками Neuro:
https://github.com/Shedou/Neuro

- Блог Overclockers:
https://overclockers.ru/blog/Hard-Workshop


- Сборка основана на roop:
https://github.com/s0md3v/roop

- Python:
https://github.com/adang1345/PythonWin7

- ffmpeg-6.0-full_build-shared:
https://www.gyan.dev/ffmpeg/builds/

..........................................................
..........................................................
..........................................................
..........................................................

--- Список изменений:

-- 2023-08-xx: roop Neuro
- Первая версия сборки.

..........................................................
..........................................................
17 changes: 17 additions & 0 deletions roop_Neuro/Start - DirectML.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off
set DATA=%~dp0DATA
set APPDATA=%DATA%\AppData\Roaming
set LOCALAPPDATA=%DATA%\AppData\Local
set HOMEDRIVE=%~d0%
set HOMEPATH=%~p0%DATA
set USERPROFILE=%DATA%

set DIR=%~dp0Depends
set PATH=C:\Windows\system32;C:\Windows;%DIR%\git\bin;%DIR%\python310;%DIR%\python310\Scripts;%DIR%\ffmpeg-6.0-full_build-shared\bin
set TRANSFORMERS_CACHE=%DIR%\transformers-cache

set GIT_SSL_NO_VERIFY=true

cd roop\

python run.py --execution-provider dml
17 changes: 17 additions & 0 deletions roop_Neuro/Start.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off
set DATA=%~dp0DATA
set APPDATA=%DATA%\AppData\Roaming
set LOCALAPPDATA=%DATA%\AppData\Local
set HOMEDRIVE=%~d0%
set HOMEPATH=%~p0%DATA
set USERPROFILE=%DATA%

set DIR=%~dp0Depends
set PATH=C:\Windows\system32;C:\Windows;%DIR%\git\bin;%DIR%\python310;%DIR%\python310\Scripts;%DIR%\ffmpeg-6.0-full_build-shared\bin
set TRANSFORMERS_CACHE=%DIR%\transformers-cache

set GIT_SSL_NO_VERIFY=true

cd roop\

python run.py --execution-provider cpu

0 comments on commit ccdbfb2

Please sign in to comment.