From 1c02c8d9606bcb45340cb300e4619606774d308c Mon Sep 17 00:00:00 2001 From: Cheng Date: Sun, 15 Sep 2024 20:07:45 +0900 Subject: [PATCH] Update README with screencast --- README.md | 14 ++++++++++++-- src/cli.ts | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eeb0aac..910b3cd 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Semantic Image Search CLI (sisi) -:construction: - CLI tool for semantic image search, locally without Internet. Powered by [node-mlx](https://github.com/frost-beta/node-mlx), a machine learning framework for Node.js. +https://github.com/user-attachments/assets/66e6e437-c27b-48cf-80cc-a5a0c8c0bdfb + ## Supported platforms GPU support: @@ -87,6 +87,16 @@ It works with local files too: sisi search file:///Users/Your/Pictures/cat.jpg ``` +## Under the hood + +The index is built by computing the embeddings of images using the [CLIP +model](https://github.com/openai/CLIP), and then stored in a binary JSON file. + +Searching the images is computing cosine similarities between the query string +and the indexed embeddings. There is no database involved here, everytime you do +a search the computation is done for all the embeddings stored, which is very +fast even when you have tens of thousands of pictures. + ## License MIT diff --git a/src/cli.ts b/src/cli.ts index bbeabe8..0fce6ae 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -51,7 +51,7 @@ export class SearchCommand extends Command { query = Option.String(); target = Option.String('--in', {description: 'The directory where images are searched.'}); - max = Option.String('--max', 20, {description: 'The maximum number of results to return.'}); + max = Option.String('--max', '20', {description: 'The maximum number of results to return.'}); print = Option.Boolean('--print', {description: 'Print the results to stdout.'}); async execute() {