GameSentenceMiner 2.19.8__py3-none-any.whl → 2.19.10__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.

Potentially problematic release.


This version of GameSentenceMiner might be problematic. Click here for more details.

GameSentenceMiner/obs.py CHANGED
@@ -581,7 +581,10 @@ def get_active_video_sources():
581
581
  if not scene_items_response:
582
582
  return None
583
583
  video_sources = ['window_capture', 'game_capture', 'monitor_capture']
584
- return [item for item in scene_items_response if item.get('inputKind') in video_sources]
584
+ active_video_sources = [item for item in scene_items_response if item.get('inputKind') in video_sources]
585
+ # active_video_sources = []
586
+
587
+ return active_video_sources if active_video_sources else [scene_items_response[0]]
585
588
 
586
589
  def get_record_directory():
587
590
  try:
@@ -1595,7 +1595,7 @@ class MeikiTextDetector:
1595
1595
  available = False
1596
1596
  key = ']'
1597
1597
 
1598
- def __init__(self, model_name: str = 'tiny'):
1598
+ def __init__(self, model_name: str = 'small'):
1599
1599
  """
1600
1600
  Initializes the detector by downloading and loading the specified ONNX model.
1601
1601
 
@@ -1606,7 +1606,7 @@ class MeikiTextDetector:
1606
1606
  if model_name not in ['tiny', 'small']:
1607
1607
  raise ValueError("model_name must be either 'tiny' or 'small'")
1608
1608
 
1609
- ort.preload_dlls(cuda=True, directory=None)
1609
+ ort.preload_dlls(cuda=False, cudnn=False, directory=None)
1610
1610
 
1611
1611
  self.model_name = model_name
1612
1612
  self.session = None
@@ -460,12 +460,15 @@ def find_black_bars(video_file, screenshot_timing):
460
460
 
461
461
  logger.debug(f"Original video dimensions: {orig_width}x{orig_height}")
462
462
 
463
+ ss_seek = max(0, float(screenshot_timing) - 0.5)
463
464
  cropdetect_command = ffmpeg_base_command_list_info + [
465
+ "-ss", str(ss_seek), # fast input seek
464
466
  "-i", video_file,
465
- "-ss", f"{screenshot_timing}", # Start near the screenshot time
466
- "-t", "1", # Analyze for 1 second
467
- "-vf", "cropdetect=limit=16", # limit=0 means true black only, round=2 for even dimensions
468
- "-f", "null", "-" # Discard video output
467
+ "-t", "1", # analyze ~1 second
468
+ "-an", # ignore audio
469
+ "-vf", "cropdetect=limit=16:round=2",
470
+ "-frames:v", "8", # only analyze a few frames
471
+ "-f", "null", "-"
469
472
  ]
470
473
 
471
474
  result = subprocess.run(
@@ -496,6 +499,11 @@ def find_black_bars(video_file, screenshot_timing):
496
499
  logger.debug(f"Crop would be {crop_width}x{crop_height} ({area_ratio:.1%} of original area)")
497
500
  logger.debug(f"Original aspect ratio: {orig_aspect:.3f}, Crop aspect ratio: {crop_aspect:.3f}, Difference: {aspect_diff:.1%}")
498
501
 
502
+ # If the crop is within 1% of the original aspect ratio, don't crop
503
+ if aspect_diff < 0.01:
504
+ logger.info("Detected crop does not significantly change aspect ratio. Skipping crop.")
505
+ return None
506
+
499
507
  # Safeguards:
500
508
  # 1. Crop must retain at least 25% of the original video area
501
509
  # 2. Aspect ratio must not change by more than 30%
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.19.8
3
+ Version: 2.19.10
4
4
  Summary: A tool for mining sentences from games. Update: Dependencies, replay buffer based line searching, and bug fixes.
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -2,7 +2,7 @@ GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
2
2
  GameSentenceMiner/anki.py,sha256=5hp5WsNp7spazjQF9rZrNzOoQ2ZPFIl2sTdU5oDSWRE,29924
3
3
  GameSentenceMiner/gametext.py,sha256=4PPm7QSWDmvsyooVjFANkd1Vnoy5ixbGRMHfYfhwGs0,13320
4
4
  GameSentenceMiner/gsm.py,sha256=dg41VMDLzR3U8-Xm1oHGfU2JKL8cyH-WacqY6tLrWyM,36164
5
- GameSentenceMiner/obs.py,sha256=TuTTHJ09S4uEwh0dJx4B5LnQlL-sTIKj8Xap5YsZ3KU,43160
5
+ GameSentenceMiner/obs.py,sha256=UB4_OJ-vZQbHyuupB8JmwhSFdYyQX_5f5TpRXU1D7Kk,43300
6
6
  GameSentenceMiner/vad.py,sha256=iMSsoUZ7-aNoWKzDKfOHdB3Zk5U2hV7x5hqTny6rj08,21501
7
7
  GameSentenceMiner/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  GameSentenceMiner/ai/ai_prompting.py,sha256=mq9Odv_FpohXagU-OoSZbLWttdrEl1M1NiqnodeUpD8,29126
@@ -27,7 +27,7 @@ GameSentenceMiner/owocr/owocr/__init__.py,sha256=87hfN5u_PbL_onLfMACbc0F5j4KyIK9
27
27
  GameSentenceMiner/owocr/owocr/__main__.py,sha256=XQaqZY99EKoCpU-gWQjNbTs7Kg17HvBVE7JY8LqIE0o,157
28
28
  GameSentenceMiner/owocr/owocr/config.py,sha256=qM7kISHdUhuygGXOxmgU6Ef2nwBShrZtdqu4InDCViE,8103
29
29
  GameSentenceMiner/owocr/owocr/lens_betterproto.py,sha256=oNoISsPilVVRBBPVDtb4-roJtAhp8ZAuFTci3TGXtMc,39141
30
- GameSentenceMiner/owocr/owocr/ocr.py,sha256=yVrLr8nNgvLRB-pPvkyhw07zkAiWrCf85SvgfQBquEk,95309
30
+ GameSentenceMiner/owocr/owocr/ocr.py,sha256=Phud8ABUW2i5Q0HBa6vKLwznS3kBR64NzCcDFSL1pS4,95324
31
31
  GameSentenceMiner/owocr/owocr/run.py,sha256=4fyA6r4LLOJWIehwNHPfnZOb_2ebDGtS9i5bhZ3DsNo,82779
32
32
  GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py,sha256=Na6XStbQBtpQUSdbN3QhEswtKuU1JjReFk_K8t5ezQE,3395
33
33
  GameSentenceMiner/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -45,7 +45,7 @@ GameSentenceMiner/util/audio_player.py,sha256=-yFsf0qoTSS1ga5rCmEJZJGUSJzXCvfZHY
45
45
  GameSentenceMiner/util/configuration.py,sha256=X6AFueDXi-HabDCGf8u44Z1rPO8XR6Wal3SvGz7hcbI,48806
46
46
  GameSentenceMiner/util/db.py,sha256=iCHUzlgOJgNjQ5-oDa7gnDWmzdlEryOzbXfn9ToQPfY,33034
47
47
  GameSentenceMiner/util/electron_config.py,sha256=KfeJToeFFVw0IR5MKa-gBzpzaGrU-lyJbR9z-sDEHYU,8767
48
- GameSentenceMiner/util/ffmpeg.py,sha256=iJAo2GUF0B4SDhG9rp-xaA94VSAc00aY1SyRRZ-i_1w,39730
48
+ GameSentenceMiner/util/ffmpeg.py,sha256=KZhoVVCGnlPIoVJ83XVQmjHDnzO4WefZRoLyceS6pEE,40100
49
49
  GameSentenceMiner/util/games_table.py,sha256=VM68MAsdyE6tpdwM4bDSk67qioBOvsEO8-TpnRmUnSo,12003
50
50
  GameSentenceMiner/util/get_overlay_coords.py,sha256=jQ0hcrEh9CfvjlBRJez3Ly-er4MjBWC2zirA-hYz5hQ,26462
51
51
  GameSentenceMiner/util/gsm_utils.py,sha256=mASECTmN10c2yPL4NEfLg0Y0YWwFso1i6r_hhJPR3MY,10974
@@ -135,9 +135,9 @@ GameSentenceMiner/web/templates/components/kanji_grid/thousand_character_classic
135
135
  GameSentenceMiner/web/templates/components/kanji_grid/wanikani_levels.json,sha256=8wjnnaYQqmho6t5tMxrIAc03512A2tYhQh5dfsQnfAM,11372
136
136
  GameSentenceMiner/web/templates/components/kanji_grid/words_hk_frequency_list.json,sha256=wRkqZNPzz6DT9OTPHpXwfqW96Qb96stCQNNgOL-ZdKk,17535
137
137
  GameSentenceMiner/wip/__init___.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
- gamesentenceminer-2.19.8.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
139
- gamesentenceminer-2.19.8.dist-info/METADATA,sha256=4M3TSSE1ZAO0GVyam1krpDM7tZkvxMyE5KsMzNUGBYM,8180
140
- gamesentenceminer-2.19.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
141
- gamesentenceminer-2.19.8.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
142
- gamesentenceminer-2.19.8.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
143
- gamesentenceminer-2.19.8.dist-info/RECORD,,
138
+ gamesentenceminer-2.19.10.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
139
+ gamesentenceminer-2.19.10.dist-info/METADATA,sha256=EhqseprTQY7un78Qu-PUZsLehPILBcKMlJIVwiikvAk,8181
140
+ gamesentenceminer-2.19.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
141
+ gamesentenceminer-2.19.10.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
142
+ gamesentenceminer-2.19.10.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
143
+ gamesentenceminer-2.19.10.dist-info/RECORD,,