GameSentenceMiner 2.19.9__py3-none-any.whl → 2.19.11__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/anki.py +4 -3
- GameSentenceMiner/gsm.py +1 -1
- GameSentenceMiner/util/ffmpeg.py +12 -4
- {gamesentenceminer-2.19.9.dist-info → gamesentenceminer-2.19.11.dist-info}/METADATA +1 -1
- {gamesentenceminer-2.19.9.dist-info → gamesentenceminer-2.19.11.dist-info}/RECORD +9 -9
- {gamesentenceminer-2.19.9.dist-info → gamesentenceminer-2.19.11.dist-info}/WHEEL +0 -0
- {gamesentenceminer-2.19.9.dist-info → gamesentenceminer-2.19.11.dist-info}/entry_points.txt +0 -0
- {gamesentenceminer-2.19.9.dist-info → gamesentenceminer-2.19.11.dist-info}/licenses/LICENSE +0 -0
- {gamesentenceminer-2.19.9.dist-info → gamesentenceminer-2.19.11.dist-info}/top_level.txt +0 -0
GameSentenceMiner/anki.py
CHANGED
|
@@ -376,12 +376,13 @@ def fix_overlay_whitespace(last_note: AnkiCard, note, lines=None):
|
|
|
376
376
|
return note, last_note
|
|
377
377
|
|
|
378
378
|
|
|
379
|
-
def get_initial_card_info(last_note: AnkiCard, selected_lines):
|
|
379
|
+
def get_initial_card_info(last_note: AnkiCard, selected_lines, game_line: GameLine):
|
|
380
380
|
note = {'id': last_note.noteId, 'fields': {}}
|
|
381
381
|
if not last_note:
|
|
382
382
|
return note, last_note
|
|
383
383
|
note, last_note = fix_overlay_whitespace(last_note, note, selected_lines)
|
|
384
|
-
|
|
384
|
+
if not game_line:
|
|
385
|
+
game_line = get_text_event(last_note)
|
|
385
386
|
sentences = []
|
|
386
387
|
sentences_text = ''
|
|
387
388
|
|
|
@@ -597,7 +598,7 @@ def update_card_from_same_sentence(last_card, lines, game_line):
|
|
|
597
598
|
return
|
|
598
599
|
|
|
599
600
|
if anki_result.success:
|
|
600
|
-
note, last_card = get_initial_card_info(last_card, lines)
|
|
601
|
+
note, last_card = get_initial_card_info(last_card, lines, game_line)
|
|
601
602
|
tango = last_card.get_field(get_config().anki.word_field)
|
|
602
603
|
update_anki_card(last_card, note=note,
|
|
603
604
|
game_line=get_mined_line(last_card, lines), use_existing_files=True, tango=tango)
|
GameSentenceMiner/gsm.py
CHANGED
|
@@ -203,7 +203,7 @@ class VideoToAudioHandler(FileSystemEventHandler):
|
|
|
203
203
|
last_note = anki.get_last_anki_card()
|
|
204
204
|
|
|
205
205
|
note, last_note = anki.get_initial_card_info(
|
|
206
|
-
last_note, selected_lines)
|
|
206
|
+
last_note, selected_lines, game_line=mined_line)
|
|
207
207
|
tango = last_note.get_field(
|
|
208
208
|
get_config().anki.word_field) if last_note else ''
|
|
209
209
|
|
GameSentenceMiner/util/ffmpeg.py
CHANGED
|
@@ -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
|
-
"-
|
|
466
|
-
"-
|
|
467
|
-
"-vf", "cropdetect=limit=16
|
|
468
|
-
"-
|
|
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.
|
|
3
|
+
Version: 2.19.11
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
GameSentenceMiner/anki.py,sha256=
|
|
2
|
+
GameSentenceMiner/anki.py,sha256=SvmkL-7AqMKtCWfgwyxALvEHBOoxmQabi_uSYahf5nU,29982
|
|
3
3
|
GameSentenceMiner/gametext.py,sha256=4PPm7QSWDmvsyooVjFANkd1Vnoy5ixbGRMHfYfhwGs0,13320
|
|
4
|
-
GameSentenceMiner/gsm.py,sha256=
|
|
4
|
+
GameSentenceMiner/gsm.py,sha256=N4m3tqesHkwkgLeOAlBvzwCYiy2INNZ85maZWCdglUM,36186
|
|
5
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
|
|
@@ -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=
|
|
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.
|
|
139
|
-
gamesentenceminer-2.19.
|
|
140
|
-
gamesentenceminer-2.19.
|
|
141
|
-
gamesentenceminer-2.19.
|
|
142
|
-
gamesentenceminer-2.19.
|
|
143
|
-
gamesentenceminer-2.19.
|
|
138
|
+
gamesentenceminer-2.19.11.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
139
|
+
gamesentenceminer-2.19.11.dist-info/METADATA,sha256=-hBqArM8oQ4wYMUg9-LaRzUXNSy-MGgEmLFewxN4QyQ,8181
|
|
140
|
+
gamesentenceminer-2.19.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
141
|
+
gamesentenceminer-2.19.11.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
|
|
142
|
+
gamesentenceminer-2.19.11.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
|
|
143
|
+
gamesentenceminer-2.19.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|