diff --git a/README.md b/README.md index 762eb10..4065318 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Selective Search Implementation for Python -This is a simple Selective Search Implementation for Python +This is a specially modified version of Selective Search Implementation for Python3. ## Install diff --git a/selectivesearch/__init__.py b/selectivesearch/__init__.py index 4162e21..4bb2cd9 100644 --- a/selectivesearch/__init__.py +++ b/selectivesearch/__init__.py @@ -1 +1 @@ -from selectivesearch import selective_search # NOQA +from .selectivesearch import selective_search diff --git a/selectivesearch/selectivesearch.py b/selectivesearch/selectivesearch.py index 13b6cb1..04c8fec 100644 --- a/selectivesearch/selectivesearch.py +++ b/selectivesearch/selectivesearch.py @@ -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:]: @@ -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 x: x[1])[-1][0] # merge corresponding regions t = max(R.keys()) + 1.0