Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
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
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 x: x[1])[-1][0]

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