Skip to content

Commit 1ef827c

Browse files
committed
[FIX] Remove need of calling createIndex() at end.
1 parent 85ea4b0 commit 1ef827c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

examples/index.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def create_index(name, images):
2323
# Add images in batch (List of image paths locally stored)
2424
index.addImageBatch(images[1:])
2525

26+
# Build the index
27+
index.createIndex()
28+
2629
return index
2730

2831

imsearch/index.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def __init__(self, name):
4141
self._repository_db = get_repository(self.name, 'mongo')
4242

4343
def __del__(self):
44+
self._nmslib_index.createIndex()
4445
Index.object_counter -= 1
4546
if Index.object_counter == 0 and Index.fe is not None:
4647
Index.fe.terminate()

0 commit comments

Comments
 (0)