voicemate.hots.screen.portraits

Reading the ban slots by comparing their pictures with the hero portraits.

A ban shows only the hero’s face in one of six slots at the top of the draft screen; the name appears for two seconds in the middle and is easy to miss. The portraits Adam saved from Icy Veins show the same art, so each slot is matched against all of them by normalized correlation (a few scales and shifts), on the CPU with no model. Looks at a slot that did not change are answered from a cache.

Attributes

Classes

Portraits

The hero portraits and the ban-slot matcher.

Module Contents

voicemate.hots.screen.portraits.logger
voicemate.hots.screen.portraits.SLOT_CENTERS: tuple[float, ...] = (0.1635, 0.215, 0.267, 0.734, 0.786, 0.838)
voicemate.hots.screen.portraits.SLOT_HALF_WIDTH: float = 0.0177
voicemate.hots.screen.portraits.SLOT_TOP: float = 0.0262
voicemate.hots.screen.portraits.SLOT_BOTTOM: float = 0.0707
voicemate.hots.screen.portraits.PATCH: tuple[int, int] = (24, 34)
voicemate.hots.screen.portraits.SCALES: tuple[int, ...] = (39, 42, 46, 50)
voicemate.hots.screen.portraits.STEP: int = 2
voicemate.hots.screen.portraits.MIN_SCORE: float = 0.65
voicemate.hots.screen.portraits.MIN_MARGIN: float = 0.06
voicemate.hots.screen.portraits.FILE_PREFIX: str = 'img_hero-portraits_'
voicemate.hots.screen.portraits.REMEMBER: int = 256
class voicemate.hots.screen.portraits.Portraits(images: dict[str, PIL.Image.Image], remember: int = REMEMBER)[source]

The hero portraits and the ban-slot matcher.

Parameters:
  • images – slug → portrait (any size; RGB).

  • remember – How many slot pictures to keep the answer for.

slugs
classmethod from_folder(folder: pathlib.Path) → Portraits[source]

Load the portraits saved in folder (img_hero-portraits_<slug>.jpg).

bans(image: numpy.ndarray) → tuple[str, ...][source]

The heroes shown in the six ban slots of a draft screen, left to right.