How to Configure the DL OCR

Modified on Tue, 10 Sep at 6:46 PM

Friendly Reminder: For the most up-to-date information regarding this article, please use the following link: https://confluence.sportradar.ag/display/SK/DL+OCR+configuration

 


Arenas that already exist and need DL Configured, please use the information below to migrate the reader file.


 

Use the command kee migration scoreboard_prm to convert the scoreboard reader parameter file (.prm) to the format that enables the new DL OCR.

$kee migration scoreboard_prm --help
Usage: kee migration scoreboard_prm [OPTIONS]
Options:
-r, --reader TEXT         reader (e.g. reader3)   [required]
-m, --model_name TEXT     DL model filename (default ocr_scorboard.pt)
-w, --overwrite           overwrite old prm with new
--dbconfig TEXT           dbconfig folder (default /home/setup/dbconfig)
--help                    Show this message and exit.

 

Below is an example of the commands to migrate

The command below will convert the .prm file for reader3 and overwrite the old file (a backup file reader3.prm.orig is created).

kee migration scoreboard_prm -r reader3 -w

 

Don’t forget to push the changes to the database using the command below:

kee config send -m "migrate reader1/2/3 to DL OCR"

 

The migration converts all the “digits” in the .prm to “numbers” and the resulting file will look like similar to the information below:



Pro Tip: The line read_function=dl_model enables the DL OCR.

 

New arenas that need DL configured

The configuration of the DL OCR in new arenas is similar to the configuration of the older SVM reader calibration but simpler. Once an image is captured within the reader section of WebAdmin and the scoreboard light is turned on, use the information below to configure the scoreboard:

  • Open the calibration tool in Webadmin under the "Readers" section

  • Add the configuration information below:

    • deep_learning_model: type ocr_scoreboard.pt

    • read_function: select dl_model

  • Add the numbers to be decoded and draw bounding boxes around the numbers. (Scoreboard, Shot Clock, Game Clock Score and Quarter)

  • If the number is the game clock, add a configuration using the parse_function and select chronometer_blob

  • If the number is the quarter, add a configuration using the parse_function and select quarter

  • If the number is the shotclock, add the configuration using the parse_function and select shotclock_dlocr. This parse function assumes the shotclock switches to “second.decisecond” format (e.g 4.9, 4.8, 4.7, etc.) for times below 5s.

  • Update director within WebAdmin



Friendly Reminder: There is no other parameters to set (no luminance threshold, etc.)

 

 

How to disable the DL OCR

Simply revert the reader config file (readerX.prm) to its original state. The migration tool saves a backup copy of the file (readerX.prm.orig), to revert back to the previous situation.

 

 


Additional notes

Scoreboard LEDs - LEDs are still supported. Configuring LEDs is done as before. If the .prm file contain *_leds properties, they will be migrated to the new file format.


 

Antiflicker and Priority - Antiflicker digits (check out the following article: How to deal with a flickering shotclock or scoreboard) Antiflicker digits will be migrated to the new format.


 

The priority property is still supported. It is useful when the same number is read by different readers (e.g. the game clock can be read from CAMCOURT and scoreboard cameras), and one of them is more reliable. The priority value gives more weight to the reader that has the largest priority.


 

Requested Stability - Requested stability (parameter requested_stability_ms) is still supported and will be migrated. It represents a duration in ms. It is required that the number is read for a duration greater or equal to the requested_stability, otherwise it’s considered as invalid. By defaults it is set to 100ms.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article