Skip to content

Commit

Permalink
Update README with screencast
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Sep 15, 2024
1 parent bfa3165 commit 1c02c8d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 1c02c8d

Please sign in to comment.