mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 21:12:07 -07:00
_
This commit is contained in:
parent
803f7f9717
commit
516e23584e
1 changed files with 5 additions and 23 deletions
|
@ -7,7 +7,7 @@ import types
|
||||||
import colorama
|
import colorama
|
||||||
import cv2
|
import cv2
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
from core import stdex
|
||||||
try:
|
try:
|
||||||
import IPython #if success we are in colab
|
import IPython #if success we are in colab
|
||||||
from IPython.display import display, clear_output
|
from IPython.display import display, clear_output
|
||||||
|
@ -359,31 +359,13 @@ class InteractBase(object):
|
||||||
def input_process(self, stdin_fd, sq, str):
|
def input_process(self, stdin_fd, sq, str):
|
||||||
sys.stdin = os.fdopen(stdin_fd)
|
sys.stdin = os.fdopen(stdin_fd)
|
||||||
try:
|
try:
|
||||||
|
print(str, end='\r')
|
||||||
|
stdex.suppress_stdout_stderr().__enter__()
|
||||||
inp = input (str)
|
inp = input (str)
|
||||||
sq.put (True)
|
sq.put (True)
|
||||||
except:
|
except:
|
||||||
sq.put (False)
|
sq.put (False)
|
||||||
|
|
||||||
print("111")
|
|
||||||
outnull_file = open(os.devnull, 'w')
|
|
||||||
errnull_file = open(os.devnull, 'w')
|
|
||||||
|
|
||||||
old_stdout_fileno_undup = sys.stdout.fileno()
|
|
||||||
old_stderr_fileno_undup = sys.stderr.fileno()
|
|
||||||
|
|
||||||
old_stdout_fileno = os.dup ( sys.stdout.fileno() )
|
|
||||||
old_stderr_fileno = os.dup ( sys.stderr.fileno() )
|
|
||||||
|
|
||||||
old_stdout = sys.stdout
|
|
||||||
old_stderr = sys.stderr
|
|
||||||
|
|
||||||
os.dup2 ( outnull_file.fileno(), old_stdout_fileno_undup )
|
|
||||||
os.dup2 ( errnull_file.fileno(), old_stderr_fileno_undup )
|
|
||||||
|
|
||||||
sys.stdout = outnull_file
|
|
||||||
sys.stderr = errnull_file
|
|
||||||
print("222")
|
|
||||||
|
|
||||||
def input_in_time (self, str, max_time_sec):
|
def input_in_time (self, str, max_time_sec):
|
||||||
sq = multiprocessing.Queue()
|
sq = multiprocessing.Queue()
|
||||||
p = multiprocessing.Process(target=self.input_process, args=( sys.stdin.fileno(), sq, str))
|
p = multiprocessing.Process(target=self.input_process, args=( sys.stdin.fileno(), sq, str))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue