kel-z / HSR-Scanner

Scanner for exporting light cone, relic, and character data from Honkai: Star Rail to JSON format.
GNU General Public License v3.0
178 stars 11 forks source link

Strange error during OCR #98

Open mood-xox opened 1 week ago

mood-xox commented 1 week ago

Hi, I recently got the updated version of this and despite both lowering the scan speed and ensuring the background is dark enough (hasn't been a problem before, but wanted to make sure), it's started to give me an error every time it reaches a certain point after finishing the scan.

It happens during the OCR process, all the way past the light cones and relics, during the characters.

It also seems to be having trouble with superimposed LCs but here's what shows up:

19:24:41] [INFO] > Starting OCR process. Please wait... [19:24:42] [ERROR] > Light Cone UID 31: Failed to parse superimposition. Setting to 1. [19:24:42] [ERROR] > Light Cone UID 13: Failed to parse superimposition. Setting to 1. [19:24:43] [ERROR] > Light Cone UID 24: Failed to parse superimposition. Setting to 1. [19:24:43] [ERROR] > Light Cone UID 32: Failed to parse superimposition. Setting to 1. [19:24:44] [ERROR] > Light Cone UID 11: Failed to parse superimposition. Setting to 1. [19:24:44] [ERROR] > Light Cone UID 18: Failed to parse superimposition. Setting to 1. [19:24:44] [ERROR] > Light Cone UID 10: Failed to parse superimposition. Setting to 1. [19:24:45] [ERROR] > Light Cone UID 12: Failed to parse superimposition. Setting to 1. [19:24:45] [ERROR] > Light Cone UID 25: Failed to parse superimposition. Setting to 1. [19:24:46] [ERROR] > Light Cone UID 23: Failed to parse superimposition. Setting to 1. [19:26:15] [FATAL] > Scan aborted with error KeyError: 'key' Stack trace: "Traceback (most recent call last): File "services\scanner\parsers\character_parser.py", line 127, in parse ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "main.py", line 610, in run File "asyncio\runners.py", line 44, in run File "asyncio\base_events.py", line 646, in run_until_complete File "services\scanner\scanner.py", line 191, in start_scan File "asyncio\threads.py", line 25, in to_thread File "concurrent\futures\thread.py", line 58, in run File "services\scanner\parsers\character_parser.py", line 130, in parse KeyError: 'key' " (Try increasing nav/scan delay in the scanner settings, or scan with a different in-game background, window resolution, or fullscreen/windowed mode.)

I'm not really sure what to do. I'll probably try reinstalling, but I figured it'd be probably a good idea to post about it

kel-z commented 1 week ago

Ah, looks like I forgot to update the error message logic for when something doesn't parse correctly during character scanning after I updated the output format. I'll address that in the next release, thank you!

To help with the superimposed LC problem, it'll help to turn on "Debug Mode" in the configuration settings and see if the screenshots that the scanner takes looks correct, and then we can proceed from there