Skip to content

Commit

Permalink
Fix: Multiple right doors are classified as left and right doors
Browse files Browse the repository at this point in the history
  • Loading branch information
LmeSzinc committed May 13, 2024
1 parent caf3af9 commit 5f9ec0e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tasks/rogue/route/exit.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,17 @@ def predict_door_by_name(self, image) -> tuple[MapPlane | None, MapPlane | None]
else:
return None, results[0].matched_keyword
else:
results = [r for d, r in sorted(zip(directions, results))]
return results[0].matched_keyword, results[-1].matched_keyword
left = [r for d, r in sorted(zip(directions, results)) if d < 0]
right = [r for d, r in sorted(zip(directions, results)) if d >= 0]
if len(left):
left = left[0].matched_keyword
else:
left = None
if len(right):
right = right[-1].matched_keyword
else:
right = None
return left, right

def choose_door(self, left_door: MapPlane | None, right_door: MapPlane | None) -> str | None:
"""
Expand Down

0 comments on commit 5f9ec0e

Please sign in to comment.