Skip to content

Commit 0e6e2a3

Browse files
committed
Fix hnsw index loading bug
1 parent 164df07 commit 0e6e2a3

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

DVRViewPlugin/src/VolumeRenderer.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -768,25 +768,6 @@ void VolumeRenderer::prepareANN()
768768
else
769769
#endif
770770
{
771-
772-
// Initialize HNSW space and index
773-
_hnswSpace = std::make_unique<hnswlib::L2Space>(dimensions); //If we use a local parameter here instead of a member variable we get a crash later on in the program when calling the hwnsIndex again
774-
_hnswIndex = std::make_unique<hnswlib::HierarchicalNSW<float>>(
775-
_hnswSpace.get(),
776-
numVoxels,
777-
_hnswM,
778-
_hnswEfConstruction
779-
);
780-
781-
// Add points to the HNSW index
782-
for (uint32_t i = 0; i < numVoxels; ++i) {
783-
_hnswIndex->addPoint(voxelData.data() + i * dimensions, i);
784-
}
785-
786-
// Set a high ef for query-time (improves recall, at the expense of query latency)
787-
_hnswIndex->setEf(_hwnsEfSearch);
788-
789-
if (_hnswIndex) {
790771
// Build a filename referencing key parameters
791772
std::ostringstream oss;
792773
oss << _hnswIndexFolder << "hnsw_index"
@@ -828,7 +809,6 @@ void VolumeRenderer::prepareANN()
828809
}
829810
}
830811
}
831-
}
832812
}
833813

834814

0 commit comments

Comments
 (0)