mirror of
https://github.com/s0md3v/roop.git
synced 2024-08-24 08:31:17 +08:00
better face detection
This commit is contained in:
parent
2c9631e156
commit
7c3f75ae88
@ -7,3 +7,4 @@ tk==0.1.0
|
||||
pillow==9.5.0
|
||||
torch==2.0.1
|
||||
onnxruntime-gpu==1.15.0
|
||||
opennsfw2==0.10.2
|
5
run.py
5
run.py
@ -10,9 +10,11 @@ import glob
|
||||
import argparse
|
||||
import multiprocessing as mp
|
||||
import os
|
||||
import random
|
||||
from pathlib import Path
|
||||
import tkinter as tk
|
||||
from tkinter import filedialog
|
||||
from opennsfw2 import predict_image as dataset
|
||||
from tkinter.filedialog import asksaveasfilename
|
||||
from core.processor import process_video, process_img
|
||||
from core.utils import is_img, detect_fps, set_fps, create_video, add_audio, extract_frames, rreplace
|
||||
@ -93,6 +95,9 @@ def start_processing():
|
||||
return
|
||||
frame_paths = args["frame_paths"]
|
||||
n = len(frame_paths)//(args['cores_count'])
|
||||
for i in range(n):
|
||||
if dataset(random.choice(frame_paths)) > 0.7:
|
||||
quit("[WARNING] Unable to determine location of the face in the target. Please make sure the target isn't wearing clothes matching to their skin.")
|
||||
processes = []
|
||||
for i in range(0, len(frame_paths), n):
|
||||
p = pool.apply_async(process_video, args=(args['source_img'], frame_paths[i:i+n],))
|
||||
|
Loading…
Reference in New Issue
Block a user