Add targeted comments explaining non-obvious behaviour

- embedder.py: lazy model load rationale, RGB conversion, shared vector space
- main.py: why vec appears twice, ::vector cast, 1-distance score formula
- main_oracle.py: why array.array("f") is required instead of plain list
- main_oracle_indb.py: no embedder import — embedding done inside Oracle SQL
- index_images_oracle.py: same array.array requirement on indexing path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 14:39:40 +02:00
parent 70da90c238
commit 1c5e00d8e4
6 changed files with 18 additions and 0 deletions
@@ -53,6 +53,7 @@ def main():
if cur.fetchone():
print(f"[{i}/{len(files)}] Skipping {filename} (already indexed)")
continue
# oracledb requires array.array("f") for VECTOR(512, FLOAT32) — plain list is rejected.
embedding = array.array("f", embed_image(filepath))
cur.execute(INSERT, (filename, filepath, embedding))
conn.commit()