Skip to content

Commit

Permalink
[FIX] Remove need of calling createIndex() at end.
Browse files Browse the repository at this point in the history
  • Loading branch information
rikenmehta03 committed Mar 19, 2020
1 parent 85ea4b0 commit 1ef827c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def create_index(name, images):
# Add images in batch (List of image paths locally stored)
index.addImageBatch(images[1:])

# Build the index
index.createIndex()

return index


Expand Down
1 change: 1 addition & 0 deletions imsearch/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def __init__(self, name):
self._repository_db = get_repository(self.name, 'mongo')

def __del__(self):
self._nmslib_index.createIndex()
Index.object_counter -= 1
if Index.object_counter == 0 and Index.fe is not None:
Index.fe.terminate()
Expand Down

0 comments on commit 1ef827c

Please sign in to comment.