GameSentenceMiner 2.10.1__py3-none-any.whl → 2.10.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- GameSentenceMiner/util/audio_offset_selector.py +11 -1
- GameSentenceMiner/util/gsm_utils.py +2 -2
- GameSentenceMiner/util/ss_selector.py +17 -4
- GameSentenceMiner/web/templates/index.html +10 -10
- GameSentenceMiner/web/texthooking_page.py +11 -0
- {gamesentenceminer-2.10.1.dist-info → gamesentenceminer-2.10.2.dist-info}/METADATA +1 -1
- {gamesentenceminer-2.10.1.dist-info → gamesentenceminer-2.10.2.dist-info}/RECORD +11 -11
- {gamesentenceminer-2.10.1.dist-info → gamesentenceminer-2.10.2.dist-info}/WHEEL +0 -0
- {gamesentenceminer-2.10.1.dist-info → gamesentenceminer-2.10.2.dist-info}/entry_points.txt +0 -0
- {gamesentenceminer-2.10.1.dist-info → gamesentenceminer-2.10.2.dist-info}/licenses/LICENSE +0 -0
- {gamesentenceminer-2.10.1.dist-info → gamesentenceminer-2.10.2.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,11 @@
|
|
1
|
+
|
1
2
|
import os
|
3
|
+
import sys
|
4
|
+
|
5
|
+
sys_stdout = sys.stdout
|
6
|
+
sys_stderr = sys.stderr
|
7
|
+
sys.stdout = open(os.devnull, 'w')
|
8
|
+
sys.stderr = open(os.devnull, 'w')
|
2
9
|
import tkinter as tk
|
3
10
|
from tkinter import filedialog, messagebox
|
4
11
|
import soundfile as sf
|
@@ -175,7 +182,10 @@ class AudioOffsetGUI:
|
|
175
182
|
|
176
183
|
beg_offset = self.beg_slider.get() - 5.0
|
177
184
|
end_offset = self.duration # End offset is always full duration
|
178
|
-
|
185
|
+
sys.stdout.close()
|
186
|
+
sys.stderr.close()
|
187
|
+
sys.stdout = sys_stdout
|
188
|
+
sys.stderr = sys_stderr
|
179
189
|
print(f"{beg_offset:.2f}")
|
180
190
|
exit(0)
|
181
191
|
|
@@ -275,7 +275,7 @@ def remove_github_replacements_from_local_ocr():
|
|
275
275
|
return
|
276
276
|
|
277
277
|
if not os.path.exists(OCR_REPLACEMENTS_FILE):
|
278
|
-
logger.
|
278
|
+
logger.debug(f"Local file {OCR_REPLACEMENTS_FILE} does not exist. No replacements to remove.")
|
279
279
|
return
|
280
280
|
|
281
281
|
try:
|
@@ -307,4 +307,4 @@ def remove_github_replacements_from_local_ocr():
|
|
307
307
|
logger.debug(f"An unexpected error occurred while processing {OCR_REPLACEMENTS_FILE}: {e}")
|
308
308
|
|
309
309
|
|
310
|
-
remove_github_replacements_from_local_ocr()
|
310
|
+
remove_github_replacements_from_local_ocr()
|
@@ -1,15 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import subprocess
|
1
|
+
|
2
|
+
|
4
3
|
import os
|
5
4
|
import sys
|
5
|
+
import subprocess
|
6
6
|
|
7
|
+
# Suppress stdout and stderr during imports
|
8
|
+
sys_stdout = sys.stdout
|
9
|
+
sys_stderr = sys.stderr
|
10
|
+
sys.stdout = open(os.devnull, 'w')
|
11
|
+
sys.stderr = open(os.devnull, 'w')
|
12
|
+
|
13
|
+
import tkinter as tk
|
14
|
+
from PIL import Image, ImageTk
|
7
15
|
from GameSentenceMiner.util.gsm_utils import sanitize_filename
|
8
16
|
from GameSentenceMiner.util.configuration import get_temporary_directory, logger
|
9
17
|
from GameSentenceMiner.util.ffmpeg import ffmpeg_base_command_list
|
10
18
|
from GameSentenceMiner.util import ffmpeg
|
11
19
|
|
12
|
-
|
13
20
|
def extract_frames(video_path, timestamp, temp_dir, mode):
|
14
21
|
frame_paths = []
|
15
22
|
timestamp_number = float(timestamp)
|
@@ -98,6 +105,10 @@ def run_extraction_and_display(video_path, timestamp_str, mode):
|
|
98
105
|
if image_paths:
|
99
106
|
selected_image_path = display_images(image_paths, golden_frame)
|
100
107
|
if selected_image_path:
|
108
|
+
sys.stdout.close()
|
109
|
+
sys.stderr.close()
|
110
|
+
sys.stdout = sys_stdout
|
111
|
+
sys.stderr = sys_stderr
|
101
112
|
print(selected_image_path)
|
102
113
|
else:
|
103
114
|
logger.debug("No image was selected.")
|
@@ -105,6 +116,8 @@ def run_extraction_and_display(video_path, timestamp_str, mode):
|
|
105
116
|
logger.debug("Frame extraction failed.")
|
106
117
|
|
107
118
|
def main():
|
119
|
+
|
120
|
+
|
108
121
|
# if len(sys.argv) != 3:
|
109
122
|
# print("Usage: python script.py <video_path> <timestamp>")
|
110
123
|
# sys.exit(1)
|