From 8fd87ff897f0bce938de706e9be80826e63336f1 Mon Sep 17 00:00:00 2001 From: Somdev Sangwan Date: Thu, 1 Jun 2023 02:11:07 +0530 Subject: [PATCH 1/6] add .gitignore --- .gitignore | 4 ++++ requirements.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6b9c7e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +core/__pycache__ +core/processor_gfpgan.py +venv +inswapper_128.onnx \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 88b40db..9f17665 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,5 +9,5 @@ torch==2.0.1 onnxruntime-gpu==1.15.0 tensorflow==2.12.0 opennsfw2==0.10.2 -protobuf==3.20.2 +protobuf==3.20.3 tqdm==4.65.0 From 30fc498d7ed4aaeb87eb3842d7ca6ece99c7a25a Mon Sep 17 00:00:00 2001 From: jmp909 Date: Wed, 31 May 2023 22:23:41 +0100 Subject: [PATCH 2/6] bump protobuf to 4.23.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9f17665..70b082f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,5 +9,5 @@ torch==2.0.1 onnxruntime-gpu==1.15.0 tensorflow==2.12.0 opennsfw2==0.10.2 -protobuf==3.20.3 +protobuf==4.23.2 tqdm==4.65.0 From 43990c9367c3cb5f3c0d20436cf9eb849594c53a Mon Sep 17 00:00:00 2001 From: jmp909 Date: Wed, 31 May 2023 22:57:21 +0100 Subject: [PATCH 3/6] fix checkboxes & video fps --- core/utils.py | 2 +- run.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/utils.py b/core/utils.py index 9a1498e..ee2d422 100644 --- a/core/utils.py +++ b/core/utils.py @@ -23,7 +23,7 @@ def detect_fps(input_path): output = os.popen(f'ffprobe -v error -select_streams v -of default=noprint_wrappers=1:nokey=1 -show_entries stream=r_frame_rate "{input_path}"').read() if "/" in output: try: - return int(output.split(os.sep)[0]) // int(output.split(os.sep)[1]), output.removesuffix('\n') + return int(output.split("/")[0]) // int(output.split("/")[1]), output.removesuffix('\n') except: pass return 30, 30 diff --git a/run.py b/run.py index 85592ea..e4ede59 100755 --- a/run.py +++ b/run.py @@ -153,11 +153,11 @@ def select_target(): def toggle_fps_limit(): - args['keep_fps'] = limit_fps.get() != True + args['keep_fps'] = int(limit_fps.get() != True)a def toggle_keep_frames(): - args['keep_frames'] = keep_frames.get() != True + args['keep_frames'] = int(keep_frames.get()) def save_file(): @@ -261,13 +261,12 @@ if __name__ == "__main__": target_button.place(x=360,y=320,width=180,height=80) # FPS limit checkbox - limit_fps = tk.IntVar() + limit_fps = tk.IntVar(None, not args['keep_fps']) fps_checkbox = tk.Checkbutton(window, relief="groove", activebackground="#2d3436", activeforeground="#74b9ff", selectcolor="black", text="Limit FPS to 30", fg="#dfe6e9", borderwidth=0, highlightthickness=0, bg="#2d3436", variable=limit_fps, command=toggle_fps_limit) fps_checkbox.place(x=30,y=500,width=240,height=31) - fps_checkbox.select() # Keep frames checkbox - keep_frames = tk.IntVar() + keep_frames = tk.IntVar(None, args['keep_frames']) frames_checkbox = tk.Checkbutton(window, relief="groove", activebackground="#2d3436", activeforeground="#74b9ff", selectcolor="black", text="Keep frames dir", fg="#dfe6e9", borderwidth=0, highlightthickness=0, bg="#2d3436", variable=keep_frames, command=toggle_keep_frames) frames_checkbox.place(x=37,y=450,width=240,height=31) From 3480bfd6aaf31fec0dc52151631f7c3afa8b331f Mon Sep 17 00:00:00 2001 From: jmp909 Date: Wed, 31 May 2023 23:20:18 +0100 Subject: [PATCH 4/6] fix typo! --- run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.py b/run.py index e4ede59..bd3dfc9 100755 --- a/run.py +++ b/run.py @@ -153,7 +153,7 @@ def select_target(): def toggle_fps_limit(): - args['keep_fps'] = int(limit_fps.get() != True)a + args['keep_fps'] = int(limit_fps.get() != True) def toggle_keep_frames(): From efbff51665fa57ecb68b732ee52a8550c6fd4dda Mon Sep 17 00:00:00 2001 From: Jozef Pierlejewski Date: Wed, 31 May 2023 23:37:43 +0100 Subject: [PATCH 5/6] Delete .gitignore --- .gitignore | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b6b9c7e..0000000 --- a/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -core/__pycache__ -core/processor_gfpgan.py -venv -inswapper_128.onnx \ No newline at end of file From 4a70a0dcaaa088a32c696210ba8703ead72cb579 Mon Sep 17 00:00:00 2001 From: Somdev Sangwan Date: Thu, 1 Jun 2023 11:31:37 +0530 Subject: [PATCH 6/6] fix merge conflict --- core/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/utils.py b/core/utils.py index ee2d422..50aca35 100644 --- a/core/utils.py +++ b/core/utils.py @@ -23,7 +23,7 @@ def detect_fps(input_path): output = os.popen(f'ffprobe -v error -select_streams v -of default=noprint_wrappers=1:nokey=1 -show_entries stream=r_frame_rate "{input_path}"').read() if "/" in output: try: - return int(output.split("/")[0]) // int(output.split("/")[1]), output.removesuffix('\n') + return int(output.split("/")[0]) // int(output.split("/")[1].strip()), output.strip() except: pass return 30, 30