GameSentenceMiner 2.14.0rc1__py3-none-any.whl → 2.14.1__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/obs.py CHANGED
@@ -461,11 +461,12 @@ if __name__ == '__main__':
461
461
  from mss import mss
462
462
  logging.basicConfig(level=logging.INFO)
463
463
  # main()
464
- connect_to_obs_sync()
465
-
466
- while True:
467
- print(get_active_source())
468
- time.sleep(3)
464
+ # connect_to_obs_sync()
465
+ # img = get_screenshot_PIL(source_name="Display Capture 2", compression=75, img_format='png', width=1280, height=720)
466
+ # img.show()
467
+ # while True:
468
+ # print(get_active_source())
469
+ # time.sleep(3)
469
470
  # i = 100
470
471
  # for i in range(1, 100):
471
472
  # print(f"Getting screenshot {i}")
@@ -280,7 +280,10 @@ class GoogleLens:
280
280
  logger.info('Google Lens ready')
281
281
 
282
282
  def __call__(self, img, furigana_filter_sensitivity=0, return_coords=False):
283
- furigana_filter_sensitivity = get_furigana_filter_sensitivity()
283
+ if furigana_filter_sensitivity != None:
284
+ furigana_filter_sensitivity = get_furigana_filter_sensitivity()
285
+ else:
286
+ furigana_filter_sensitivity = 0
284
287
  lang = get_ocr_language()
285
288
  img, is_path = input_to_pil_image(img)
286
289
  if lang != self.initial_lang:
@@ -863,6 +866,8 @@ class OneOCR:
863
866
  logger.warning('OneOCR is not supported on Windows older than 10!')
864
867
  elif 'oneocr' not in sys.modules:
865
868
  logger.warning('oneocr not available, OneOCR will not work!')
869
+ elif not os.path.exists(os.path.expanduser('~/.config/oneocr/oneocr.dll')):
870
+ logger.warning('OneOCR DLLs not found, please install OwOCR Dependencies via OCR Tab in GSM.')
866
871
  else:
867
872
  try:
868
873
  self.model = oneocr.OcrEngine()
@@ -902,7 +907,10 @@ class OneOCR:
902
907
 
903
908
  def __call__(self, img, furigana_filter_sensitivity=0, return_coords=False, multiple_crop_coords=False, return_one_box=True):
904
909
  lang = get_ocr_language()
905
- furigana_filter_sensitivity = get_furigana_filter_sensitivity()
910
+ if furigana_filter_sensitivity != None:
911
+ furigana_filter_sensitivity = get_furigana_filter_sensitivity()
912
+ else:
913
+ furigana_filter_sensitivity = 0
906
914
  if lang != self.initial_lang:
907
915
  self.initial_lang = lang
908
916
  self.regex = get_regex(lang)
@@ -132,33 +132,40 @@ class OverlayProcessor:
132
132
  if not full_screenshot:
133
133
  logger.warning("Failed to get a screenshot.")
134
134
  return []
135
+ if self.oneocr:
136
+ # 2. Use OneOCR to find general text areas (fast)
137
+ _, _, oneocr_results, crop_coords_list = self.oneocr(
138
+ full_screenshot,
139
+ return_coords=True,
140
+ multiple_crop_coords=True,
141
+ return_one_box=False,
142
+ furigana_filter_sensitivity=None # Disable furigana filtering
143
+ )
135
144
 
136
- # 2. Use OneOCR to find general text areas (fast)
137
- _, _, _, crop_coords_list = self.oneocr(
138
- full_screenshot,
139
- return_coords=True,
140
- multiple_crop_coords=True,
141
- return_one_box=False,
142
- furigana_filter_sensitivity=0
143
- )
144
-
145
- # 3. Create a composite image with only the detected text regions
146
- composite_image = self._create_composite_image(
147
- full_screenshot,
148
- crop_coords_list,
149
- monitor_width,
150
- monitor_height
151
- )
145
+ # 3. Create a composite image with only the detected text regions
146
+ composite_image = self._create_composite_image(
147
+ full_screenshot,
148
+ crop_coords_list,
149
+ monitor_width,
150
+ monitor_height
151
+ )
152
+ else:
153
+ composite_image = full_screenshot
152
154
 
153
155
  # 4. Use Google Lens on the cleaner composite image for higher accuracy
154
- res, text, coords = self.lens(
156
+ res = self.lens(
155
157
  composite_image,
156
158
  return_coords=True,
157
- furigana_filter_sensitivity=0
159
+ furigana_filter_sensitivity=None # Disable furigana filtering
158
160
  )
159
161
 
162
+ if len(res) != 3:
163
+ return oneocr_results
164
+
165
+ _, _, coords = res
166
+
160
167
  if not res or not coords:
161
- return []
168
+ return oneocr_results
162
169
 
163
170
  # 5. Process the high-accuracy results into the desired format
164
171
  extracted_data = self._extract_text_with_pixel_boxes(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.14.0rc1
3
+ Version: 2.14.1
4
4
  Summary: A tool for mining sentences from games. Update: Overlay?
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -3,7 +3,7 @@ GameSentenceMiner/anki.py,sha256=mNUU0AYwsDezVug-ZXDpR71R9GGUBsmc9Gu8ftfnpf4,230
3
3
  GameSentenceMiner/config_gui.py,sha256=dFN-2mD9JTcRhjFIjaj4bFcEmMAdjudYk_A5x9rp3_U,134126
4
4
  GameSentenceMiner/gametext.py,sha256=2MHOLuuXAxrhs0tkwh9JW_BYHQ7YMf-lHfO2Kl3ACDs,10244
5
5
  GameSentenceMiner/gsm.py,sha256=GdqegZnKrTMVRvp43bK7oNlWj5OxLx2PNdVWyHL9Gc4,28282
6
- GameSentenceMiner/obs.py,sha256=smlP_BFuuMkASVDEPG3DjxJ6p617kZXuNTeQ0edtH64,18703
6
+ GameSentenceMiner/obs.py,sha256=LfczcmAF1G2-L7HxFAJJ-0rlCMy29WN2YUuDbeATP1g,18845
7
7
  GameSentenceMiner/vad.py,sha256=zFReBMvNEEaQ_YEozCTCaMdV-o40FwtlxYRb17cYZio,19125
8
8
  GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  GameSentenceMiner/ai/ai_prompting.py,sha256=gNNDkoXVjWU8-is1CVI08ir2Jo_DpGvCWkV8TLl74Gg,23375
@@ -28,7 +28,7 @@ GameSentenceMiner/owocr/owocr/__init__.py,sha256=87hfN5u_PbL_onLfMACbc0F5j4KyIK9
28
28
  GameSentenceMiner/owocr/owocr/__main__.py,sha256=XQaqZY99EKoCpU-gWQjNbTs7Kg17HvBVE7JY8LqIE0o,157
29
29
  GameSentenceMiner/owocr/owocr/config.py,sha256=qM7kISHdUhuygGXOxmgU6Ef2nwBShrZtdqu4InDCViE,8103
30
30
  GameSentenceMiner/owocr/owocr/lens_betterproto.py,sha256=oNoISsPilVVRBBPVDtb4-roJtAhp8ZAuFTci3TGXtMc,39141
31
- GameSentenceMiner/owocr/owocr/ocr.py,sha256=OeGPD6NgwKXkmgVTQfo3gulNLXwnBP7zltyKPZKPB1I,68365
31
+ GameSentenceMiner/owocr/owocr/ocr.py,sha256=3Qux9yNVhTq5gZ31jcrVeyFvLcVZCoPc0sddGFL_DUc,68792
32
32
  GameSentenceMiner/owocr/owocr/run.py,sha256=TSSZnHO_sPoTtUCsDol-v4TWPPzz_Nbf24TeBUea5I4,68498
33
33
  GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py,sha256=Na6XStbQBtpQUSdbN3QhEswtKuU1JjReFk_K8t5ezQE,3395
34
34
  GameSentenceMiner/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -40,7 +40,7 @@ GameSentenceMiner/util/configuration.py,sha256=SODstU9nrRRAmbPrubYHJuGzzuKXURNUE
40
40
  GameSentenceMiner/util/db.py,sha256=2bO0rD4i8A1hhsRBER-wgZy9IK17ibRbI8DHxdKvYsI,16598
41
41
  GameSentenceMiner/util/electron_config.py,sha256=9CA27nzEFlxezzDqOPHxeD4BdJ093AnSJ9DJTcwWPsM,8762
42
42
  GameSentenceMiner/util/ffmpeg.py,sha256=iqsdp3TbBv6KMACJxkUF3e5VWak3jHPZdIEMrUdKFtE,23073
43
- GameSentenceMiner/util/get_overlay_coords.py,sha256=zBDFSWVdBLYZQcwdICQe9stg1mG0UHnJHupkuZGlJY8,12042
43
+ GameSentenceMiner/util/get_overlay_coords.py,sha256=GmDiIOBuZbQXwa6oh5OQHVoMQvlKA9IsSkxmSblZP4w,12357
44
44
  GameSentenceMiner/util/gsm_utils.py,sha256=Piwv88Q9av2LBeN7M6QDi0Mp0_R2lNbkcI6ekK5hd2o,11851
45
45
  GameSentenceMiner/util/model.py,sha256=R-_RYTYLSDNgBoVTPuPBcIHeOznIqi_vBzQ7VQ20WYk,6727
46
46
  GameSentenceMiner/util/notification.py,sha256=-qk3kTKEERzmMxx5XMh084HCyFmbfqz0XjY1hTKhCeQ,4202
@@ -69,9 +69,9 @@ GameSentenceMiner/web/templates/index.html,sha256=Gv3CJvNnhAzIVV_QxhNq4OD-pXDt1v
69
69
  GameSentenceMiner/web/templates/text_replacements.html,sha256=tV5c8mCaWSt_vKuUpbdbLAzXZ3ATZeDvQ9PnnAfqY0M,8598
70
70
  GameSentenceMiner/web/templates/utility.html,sha256=3flZinKNqUJ7pvrZk6xu__v67z44rXnaK7UTZ303R-8,16946
71
71
  GameSentenceMiner/wip/__init___.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
- gamesentenceminer-2.14.0rc1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
73
- gamesentenceminer-2.14.0rc1.dist-info/METADATA,sha256=Dtctsp_KYbHfrXer_6_pAzok5waimQ_OKsBPzCzQKZ8,1567
74
- gamesentenceminer-2.14.0rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
75
- gamesentenceminer-2.14.0rc1.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
76
- gamesentenceminer-2.14.0rc1.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
77
- gamesentenceminer-2.14.0rc1.dist-info/RECORD,,
72
+ gamesentenceminer-2.14.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
73
+ gamesentenceminer-2.14.1.dist-info/METADATA,sha256=erBDcWHYMdtMLSIH2zQiOzC2zKIuPwne795wyg0sj3Y,1564
74
+ gamesentenceminer-2.14.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
75
+ gamesentenceminer-2.14.1.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
76
+ gamesentenceminer-2.14.1.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
77
+ gamesentenceminer-2.14.1.dist-info/RECORD,,