Skip to main content

read_ivecs

Function read_ivecs 

Source
pub fn read_ivecs(path: impl AsRef<Path>) -> Result<Vec<Vec<u32>>>
Expand description

Read an .ivecs file (TEXMEX corpus format) into one Vec<u32> per record.

Identical on-disk layout to read_fvecs, but the payload is little-endian i32. SIFT ground-truth ids are always non-negative row indices, so u32 is the natural fit; this reader does not check for negative values. The same 2^20 dimension bound and truncated-record handling as read_fvecs apply.

ยงExamples

use iqdb_eval::read_ivecs;

let gt = read_ivecs(".bench-data/siftsmall/siftsmall_groundtruth.ivecs")?;
assert!(!gt.is_empty());