Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt threshold bullet points #225

Merged
merged 2 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/item/descr/texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ def _find_bullets(
use_grayscale=True,
mode=mode,
)
small_bullets = search(ref=template_list, inp_img=img_item_descr, threshold=threshold, roi=roi_bullets, use_grayscale=True, mode=mode)
small_bullets = search(
ref=template_list,
inp_img=img_item_descr,
threshold=threshold,
roi=roi_bullets,
use_grayscale=True,
mode=mode,
)
if not medium_bullets.success and not small_bullets.success:
return []
avg_score_medium = np.average([match.score for match in medium_bullets.matches])
Expand All @@ -49,7 +56,7 @@ def find_affix_bullets(img_item_descr: np.ndarray, sep_short_match: TemplateMatc
img_item_descr=img_item_descr,
sep_short_match=sep_short_match,
template_list=["affix_bullet_point", "greater_affix_bullet_point", "rerolled_bullet_point", "tempered_affix_bullet_point"],
threshold=0.85,
threshold=0.832,
mode="all",
)

Expand Down
Binary file added test/assets/item/read_descr_tempered_1080p_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions test/item/read_descr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,25 @@
rarity=ItemRarity.Legendary,
),
),
(
(1920, 1080),
f"{BASE_PATH}/read_descr_tempered_1080p_2.png",
Item(
affixes=[
Affix(name="dexterity", value=162),
Affix(name="maximum_life", value=1418),
Affix(name="critical_strike_damage", value=90),
Affix(name="marksman_critical_strike_chance", value=11, type=AffixType.tempered),
Affix(name="chance_for_rapid_fire_projectiles_to_cast_twice", value=30, type=AffixType.tempered),
],
inherent=[
Affix(name="vulnerable_damage", value=32, type=AffixType.inherent),
],
item_type=ItemType.Crossbow2H,
power=925,
rarity=ItemRarity.Legendary,
),
),
]

material = [
Expand Down
Loading