GameSentenceMiner 2.13.8__tar.gz → 2.13.10__tar.gz
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-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ocr/gsm_ocr_config.py +3 -1
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ocr/owocr_area_selector.py +31 -16
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ocr/owocr_helper.py +14 -2
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/owocr/owocr/run.py +3 -15
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/configuration.py +1 -1
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner.egg-info/PKG-INFO +1 -1
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/PKG-INFO +1 -1
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/pyproject.toml +1 -1
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ai/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ai/ai_prompting.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/anki.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/assets/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/assets/icon.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/assets/icon128.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/assets/icon256.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/assets/icon32.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/assets/icon512.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/assets/icon64.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/assets/pickaxe.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/config_gui.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/gametext.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/gsm.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/locales/en_us.json +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/locales/ja_jp.json +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/locales/zh_cn.json +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/obs.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ocr/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ocr/ocrconfig.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ocr/ss_picker.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/owocr/owocr/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/owocr/owocr/__main__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/owocr/owocr/config.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/owocr/owocr/lens_betterproto.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/owocr/owocr/ocr.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/audio_offset_selector.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/communication/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/communication/send.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/communication/websocket.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/downloader/Untitled_json.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/downloader/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/downloader/download_tools.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/downloader/oneocr_dl.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/electron_config.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/ffmpeg.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/gsm_utils.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/model.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/notification.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/package.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/ss_selector.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/text_log.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/window_transparency.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/vad.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/service.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/apple-touch-icon.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/favicon-96x96.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/favicon.ico +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/favicon.svg +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/site.webmanifest +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/style.css +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/web-app-manifest-192x192.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/web-app-manifest-512x512.png +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/templates/__init__.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/templates/index.html +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/templates/text_replacements.html +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/templates/utility.html +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/texthooking_page.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/wip/get_overlay_coords.py +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner.egg-info/SOURCES.txt +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner.egg-info/dependency_links.txt +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner.egg-info/entry_points.txt +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner.egg-info/requires.txt +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner.egg-info/top_level.txt +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/LICENSE +0 -0
- {gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/setup.cfg +0 -0
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ocr/gsm_ocr_config.py
RENAMED
@@ -33,6 +33,7 @@ class Rectangle:
|
|
33
33
|
monitor: Monitor
|
34
34
|
coordinates: List[Union[float, int]]
|
35
35
|
is_excluded: bool
|
36
|
+
is_secondary: bool = False
|
36
37
|
|
37
38
|
@dataclass_json
|
38
39
|
@dataclass
|
@@ -41,7 +42,8 @@ class WindowGeometry:
|
|
41
42
|
top: int
|
42
43
|
width: int
|
43
44
|
height: int
|
44
|
-
|
45
|
+
|
46
|
+
|
45
47
|
@dataclass_json
|
46
48
|
@dataclass
|
47
49
|
class OCRConfig:
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ocr/owocr_area_selector.py
RENAMED
@@ -34,7 +34,7 @@ class ScreenSelector:
|
|
34
34
|
def __init__(self, result, window_name, use_window_as_config, use_obs_screenshot=False):
|
35
35
|
if not selector_available:
|
36
36
|
raise RuntimeError("tkinter is not available.")
|
37
|
-
if not window_name:
|
37
|
+
if not window_name and not use_obs_screenshot:
|
38
38
|
raise ValueError("A target window name is required for configuration.")
|
39
39
|
|
40
40
|
obs.connect_to_obs_sync()
|
@@ -185,7 +185,7 @@ class ScreenSelector:
|
|
185
185
|
monitor_index = rect_data["monitor"]['index']
|
186
186
|
target_monitor = next((m for m in self.monitors if m['index'] == monitor_index), None)
|
187
187
|
if target_monitor:
|
188
|
-
self.rectangles.append((target_monitor, abs_coords, rect_data["is_excluded"]))
|
188
|
+
self.rectangles.append((target_monitor, abs_coords, rect_data["is_excluded"], rect_data.get("is_secondary", False)))
|
189
189
|
loaded_count += 1
|
190
190
|
except (KeyError, ValueError, TypeError) as e:
|
191
191
|
print(f"Skipping malformed rectangle data: {rect_data}, Error: {e}")
|
@@ -204,7 +204,7 @@ class ScreenSelector:
|
|
204
204
|
print(f"Saving rectangles to: {config_path} relative to window: {win_geom}")
|
205
205
|
|
206
206
|
serializable_rects = []
|
207
|
-
for monitor_dict, abs_coords, is_excluded in self.rectangles:
|
207
|
+
for monitor_dict, abs_coords, is_excluded, is_secondary in self.rectangles:
|
208
208
|
x_abs, y_abs, w_abs, h_abs = abs_coords
|
209
209
|
|
210
210
|
# Convert absolute pixel coordinates to percentages
|
@@ -217,7 +217,8 @@ class ScreenSelector:
|
|
217
217
|
serializable_rects.append({
|
218
218
|
"monitor": {'index': monitor_dict['index']},
|
219
219
|
"coordinates": coords_to_save,
|
220
|
-
"is_excluded": is_excluded
|
220
|
+
"is_excluded": is_excluded,
|
221
|
+
"is_secondary": is_secondary
|
221
222
|
})
|
222
223
|
|
223
224
|
save_data = {
|
@@ -254,13 +255,14 @@ class ScreenSelector:
|
|
254
255
|
|
255
256
|
def redo_last_rect(self, event=None):
|
256
257
|
if not self.redo_stack: return
|
257
|
-
monitor, abs_coords, is_excluded, old_rect_id = self.redo_stack.pop()
|
258
|
+
monitor, abs_coords, is_excluded, is_secondary, old_rect_id = self.redo_stack.pop()
|
258
259
|
canvas = event.widget.winfo_toplevel().winfo_children()[0]
|
259
260
|
x_abs, y_abs, w_abs, h_abs = abs_coords
|
260
261
|
canvas_x, canvas_y = x_abs - self.bounding_box['left'], y_abs - self.bounding_box['top']
|
262
|
+
outline_color = 'purple' if is_secondary else ('orange' if is_excluded else 'green')
|
261
263
|
new_rect_id = canvas.create_rectangle(canvas_x, canvas_y, canvas_x + w_abs, canvas_y + h_abs,
|
262
|
-
outline=
|
263
|
-
self.rectangles.append((monitor, abs_coords, is_excluded))
|
264
|
+
outline=outline_color, width=2)
|
265
|
+
self.rectangles.append((monitor, abs_coords, is_excluded, is_secondary))
|
264
266
|
self.drawn_rect_ids.append(new_rect_id)
|
265
267
|
print("Redo: Restored rectangle.")
|
266
268
|
|
@@ -291,6 +293,7 @@ class ScreenSelector:
|
|
291
293
|
"How to Use:\n"
|
292
294
|
"• Left Click + Drag: Create a capture area (green).\n"
|
293
295
|
"• Shift + Left Click + Drag: Create an exclusion area (orange).\n"
|
296
|
+
"• Ctrl + Left Click + Drag: Create a secondary (menu) area (purple).\n"
|
294
297
|
"• Right-Click on a box: Delete it."
|
295
298
|
)
|
296
299
|
tk.Label(main_frame, text=instructions_text, justify=tk.LEFT, anchor="w").pack(pady=(0, 10), fill=tk.X)
|
@@ -426,17 +429,25 @@ class ScreenSelector:
|
|
426
429
|
# --- END MODIFICATION ---
|
427
430
|
|
428
431
|
# Draw existing rectangles (which were converted to absolute pixels on load)
|
429
|
-
for _, abs_coords, is_excluded in self.rectangles:
|
432
|
+
for _, abs_coords, is_excluded, is_secondary in self.rectangles:
|
430
433
|
x_abs, y_abs, w_abs, h_abs = abs_coords
|
431
434
|
canvas_x = x_abs - self.bounding_box['left']
|
432
435
|
canvas_y = y_abs - self.bounding_box['top']
|
436
|
+
outline_color = 'purple' if is_secondary else ('orange' if is_excluded else 'green')
|
433
437
|
rect_id = self.canvas.create_rectangle(canvas_x, canvas_y, canvas_x + w_abs, canvas_y + h_abs,
|
434
|
-
outline=
|
438
|
+
outline=outline_color, width=2)
|
435
439
|
self.drawn_rect_ids.append(rect_id)
|
436
440
|
|
437
441
|
def on_click(event):
|
438
442
|
self.start_x, self.start_y = event.x, event.y
|
439
|
-
|
443
|
+
ctrl_held = bool(event.state & 0x0004)
|
444
|
+
shift_held = bool(event.state & 0x0001)
|
445
|
+
if ctrl_held:
|
446
|
+
outline = 'purple'
|
447
|
+
elif shift_held:
|
448
|
+
outline = 'orange'
|
449
|
+
else:
|
450
|
+
outline = 'green'
|
440
451
|
self.current_rect_id = self.canvas.create_rectangle(self.start_x, self.start_y, self.start_x, self.start_y,
|
441
452
|
outline=outline, width=2)
|
442
453
|
|
@@ -451,8 +462,12 @@ class ScreenSelector:
|
|
451
462
|
w, h = int(abs(coords[2] - coords[0])), int(abs(coords[3] - coords[1]))
|
452
463
|
|
453
464
|
if w >= MIN_RECT_WIDTH and h >= MIN_RECT_HEIGHT:
|
454
|
-
|
455
|
-
|
465
|
+
ctrl_held = bool(event.state & 0x0004)
|
466
|
+
shift_held = bool(event.state & 0x0001)
|
467
|
+
is_excl = shift_held
|
468
|
+
is_secondary = ctrl_held
|
469
|
+
outline_color = 'purple' if is_secondary else ('orange' if is_excl else 'green')
|
470
|
+
self.canvas.itemconfig(self.current_rect_id, outline=outline_color)
|
456
471
|
|
457
472
|
center_x, center_y = x_abs + w / 2, y_abs + h / 2
|
458
473
|
target_mon = self.monitors[0]
|
@@ -462,7 +477,7 @@ class ScreenSelector:
|
|
462
477
|
target_mon = mon
|
463
478
|
break
|
464
479
|
|
465
|
-
self.rectangles.append((target_mon, (x_abs, y_abs, w, h), is_excl))
|
480
|
+
self.rectangles.append((target_mon, (x_abs, y_abs, w, h), is_excl, is_secondary))
|
466
481
|
self.drawn_rect_ids.append(self.current_rect_id)
|
467
482
|
self.redo_stack.clear()
|
468
483
|
else:
|
@@ -472,7 +487,7 @@ class ScreenSelector:
|
|
472
487
|
def on_right_click(event):
|
473
488
|
# Iterate through our rectangles in reverse to find the topmost one.
|
474
489
|
for i in range(len(self.rectangles) - 1, -1, -1):
|
475
|
-
_monitor, abs_coords, _is_excluded = self.rectangles[i]
|
490
|
+
_monitor, abs_coords, _is_excluded, _is_secondary = self.rectangles[i]
|
476
491
|
x_abs, y_abs, w_abs, h_abs = abs_coords
|
477
492
|
canvas_x1 = x_abs - self.bounding_box['left']
|
478
493
|
canvas_y1 = y_abs - self.bounding_box['top']
|
@@ -540,7 +555,7 @@ def run_screen_selector(result_dict, window_name, use_window_as_config, use_obs_
|
|
540
555
|
|
541
556
|
def get_screen_selection(window_name, use_window_as_config=False, use_obs_screenshot=False):
|
542
557
|
if not selector_available: return None
|
543
|
-
if not window_name:
|
558
|
+
if not window_name and not use_obs_screenshot:
|
544
559
|
print("Error: A target window name must be provided.", file=sys.stderr)
|
545
560
|
return None
|
546
561
|
|
@@ -567,7 +582,7 @@ if __name__ == "__main__":
|
|
567
582
|
|
568
583
|
parser = argparse.ArgumentParser(description="Screen Selector Arguments")
|
569
584
|
parser.add_argument("window_title", nargs="?", default="", help="Target window title")
|
570
|
-
parser.add_argument("--obs_ocr", action="store_true", help="Use OBS screenshot")
|
585
|
+
parser.add_argument("--obs_ocr", action="store_true", default=True, help="Use OBS screenshot")
|
571
586
|
parser.add_argument("--use_window_for_config", action="store_true", help="Use window for config")
|
572
587
|
args = parser.parse_args()
|
573
588
|
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/ocr/owocr_helper.py
RENAMED
@@ -52,7 +52,6 @@ logger.addHandler(console_handler)
|
|
52
52
|
def get_ocr_config(window=None, use_window_for_config=False) -> OCRConfig:
|
53
53
|
"""Loads and updates screen capture areas from the corresponding JSON file."""
|
54
54
|
ocr_config_dir = get_ocr_config_path()
|
55
|
-
obs.connect_to_obs_sync(retry=0)
|
56
55
|
obs.update_current_game()
|
57
56
|
if use_window_for_config and window:
|
58
57
|
scene = sanitize_filename(window)
|
@@ -202,7 +201,7 @@ def do_second_ocr(ocr1_text, time, img, filtering, pre_crop_image=None, ignore_f
|
|
202
201
|
try:
|
203
202
|
orig_text, text = run.process_and_write_results(img, None, last_ocr2_result if not ignore_previous_result else None, filtering, None,
|
204
203
|
engine=get_ocr_ocr2(), furigana_filter_sensitivity=furigana_filter_sensitivity if not ignore_furigana_filter else 0)
|
205
|
-
|
204
|
+
|
206
205
|
if compare_ocr_results(last_sent_result, text, threshold=80):
|
207
206
|
if text:
|
208
207
|
logger.info("Seems like Text we already sent, not doing anything.")
|
@@ -447,6 +446,17 @@ def run_oneocr(ocr_config: OCRConfig, rectangles, config_check_thread):
|
|
447
446
|
|
448
447
|
def add_ss_hotkey(ss_hotkey="ctrl+shift+g"):
|
449
448
|
import keyboard
|
449
|
+
|
450
|
+
def ocr_secondary_rectangles():
|
451
|
+
logger.info("Running secondary OCR rectangles...")
|
452
|
+
ocr_config = get_ocr_config()
|
453
|
+
img = obs.get_screenshot_PIL(compression=80, img_format="jpg")
|
454
|
+
ocr_config.scale_to_custom_size(img.width, img.height)
|
455
|
+
img = run.apply_ocr_config_to_image(img, ocr_config, is_secondary=True)
|
456
|
+
do_second_ocr("", datetime.now(), img, TextFiltering(lang=get_ocr_language()), ignore_furigana_filter=True, ignore_previous_result=True)
|
457
|
+
|
458
|
+
if not manual:
|
459
|
+
keyboard.add_hotkey(get_ocr_manual_ocr_hotkey().lower(), ocr_secondary_rectangles)
|
450
460
|
secret_ss_hotkey = "F14"
|
451
461
|
filtering = TextFiltering(lang=get_ocr_language())
|
452
462
|
cropper = ScreenCropper()
|
@@ -544,6 +554,8 @@ if __name__ == "__main__":
|
|
544
554
|
use_window_for_config = args.use_window_for_config
|
545
555
|
keep_newline = args.keep_newline
|
546
556
|
obs_ocr = args.obs_ocr
|
557
|
+
|
558
|
+
obs.connect_to_obs_sync(retry=0)
|
547
559
|
|
548
560
|
# Start config change checker thread
|
549
561
|
config_check_thread = ConfigChangeCheckThread()
|
@@ -832,7 +832,6 @@ class OBSScreenshotThread(threading.Thread):
|
|
832
832
|
super().__init__(daemon=True)
|
833
833
|
self.ocr_config = ocr_config
|
834
834
|
self.interval = interval
|
835
|
-
self.obs_client = None
|
836
835
|
self.websocket = None
|
837
836
|
self.current_source = None
|
838
837
|
self.current_source_name = None
|
@@ -930,16 +929,6 @@ class OBSScreenshotThread(threading.Thread):
|
|
930
929
|
init_config()
|
931
930
|
start = time.time()
|
932
931
|
while not terminated:
|
933
|
-
if time.time() - start > 5:
|
934
|
-
if not self.obs_client:
|
935
|
-
self.connect_obs()
|
936
|
-
else:
|
937
|
-
try:
|
938
|
-
self.obs_client.get_version()
|
939
|
-
except Exception as e:
|
940
|
-
logger.error(f"Lost connection to OBS: {e}")
|
941
|
-
self.obs_client = None
|
942
|
-
self.connect_obs()
|
943
932
|
if not screenshot_event.wait(timeout=0.1):
|
944
933
|
continue
|
945
934
|
|
@@ -990,15 +979,14 @@ class OBSScreenshotThread(threading.Thread):
|
|
990
979
|
continue
|
991
980
|
|
992
981
|
|
993
|
-
def apply_ocr_config_to_image(img, ocr_config):
|
982
|
+
def apply_ocr_config_to_image(img, ocr_config, is_secondary=False):
|
994
983
|
for rectangle in ocr_config.rectangles:
|
995
984
|
if rectangle.is_excluded:
|
996
985
|
left, top, width, height = rectangle.coordinates
|
997
986
|
draw = ImageDraw.Draw(img)
|
998
|
-
draw.rectangle((left, top, left + width, top +
|
999
|
-
height), fill=(0, 0, 0, 0))
|
987
|
+
draw.rectangle((left, top, left + width, top + height), fill=(0, 0, 0, 0))
|
1000
988
|
|
1001
|
-
rectangles = [r for r in ocr_config.rectangles if not r.is_excluded]
|
989
|
+
rectangles = [r for r in ocr_config.rectangles if not r.is_excluded and r.is_secondary == is_secondary]
|
1002
990
|
|
1003
991
|
# Sort top to bottom
|
1004
992
|
if rectangles:
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/configuration.py
RENAMED
@@ -368,7 +368,7 @@ class Paths:
|
|
368
368
|
folder_to_watch: str = expanduser("~/Videos/GSM")
|
369
369
|
output_folder: str = expanduser("~/Videos/GSM/Output")
|
370
370
|
copy_temp_files_to_output_folder: bool = False
|
371
|
-
open_output_folder_on_card_creation: bool =
|
371
|
+
open_output_folder_on_card_creation: bool = False
|
372
372
|
copy_trimmed_replay_to_output_folder: bool = False
|
373
373
|
remove_video: bool = True
|
374
374
|
remove_audio: bool = False
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/owocr/owocr/__init__.py
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/owocr/owocr/__main__.py
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/owocr/owocr/config.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/communication/send.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/downloader/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/electron_config.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/notification.py
RENAMED
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/ss_selector.py
RENAMED
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/util/window_transparency.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/favicon.ico
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/favicon.svg
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/site.webmanifest
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/static/style.css
RENAMED
File without changes
|
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/templates/__init__.py
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/templates/index.html
RENAMED
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/templates/utility.html
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/web/texthooking_page.py
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner/wip/get_overlay_coords.py
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner.egg-info/entry_points.txt
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner.egg-info/requires.txt
RENAMED
File without changes
|
{gamesentenceminer-2.13.8 → gamesentenceminer-2.13.10}/GameSentenceMiner.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|