Skip to content

Commit

Permalink
Merge pull request AlpacaTechJP#15 from LogicalInnovation/fix_python3
Browse files Browse the repository at this point in the history
adjust for Python 3
  • Loading branch information
exilis authored Sep 15, 2017
2 parents 9355c3b + 1acc061 commit 590f794
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion selectivesearch/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from selectivesearch import selective_search # NOQA
from .selectivesearch import selective_search # NOQA
4 changes: 2 additions & 2 deletions selectivesearch/selectivesearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def intersect(a, b):
return True
return False

R = regions.items()
R = list(regions.items())
neighbours = []
for cur, a in enumerate(R[:-1]):
for b in R[cur + 1:]:
Expand Down Expand Up @@ -282,7 +282,7 @@ def selective_search(
while S != {}:

# get highest similarity
i, j = sorted(S.items(), cmp=lambda a, b: cmp(a[1], b[1]))[-1][0]
i, j = sorted(S.items(), key=lambda i: i[1])[-1][0]

# merge corresponding regions
t = max(R.keys()) + 1.0
Expand Down

0 comments on commit 590f794

Please sign in to comment.