Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A demo application that uses the CLIP model for natural language media search (searching images with text, and searching related images with an image).

NotificationsYou must be signed in to change notification settings

rajrajhans/bumblebee-media-search

Repository files navigation

Sneak Peek: Searching for Images with Text

 Searching Images with text 1  Searching Images with text 1
 Searching Images with text 3  Searching Images with text 4

Sneak Peek: Searching for Images with an Image

 Searching Images with an Image 1  Searching Images with an Image 2
 Searching Images with an Image 3  Searching Images with an Image 4

Nx Servings

  • This uses Nx Servings for serving the CLIP model. There are two sets of Nx Servings in the codebase:
    1. Nx Servings provided by Bumblebee for text & image embeddings: Using ready made Nx Servings provided by Bumblebee library.
    2. Hand rolled Nx Servings for text & image embeddings: Custom implemented Nx Servings intended to learn how to implement Nx Servings from scratch.
  • Both provide the same output and can be used interchangeably. However, if you're interested in learning how Nx Serving works and how to implement them, the hand rolled Nx Serving files will be helpful.

Installation

  • Uses Nix for dependency management.Install Nix if you don't have it already.
  • Clone the repository and rundirenv allow to activate the environment.
  • To install dependencies, executerun deps.
  • To start the server, executerun server.

Using with Your Images

  • Create a directorypriv/images and copy all your images to this directory.
  • Run the functionbuild_index to create an index from the images. It will vectorize the images, create index and save it topriv/clip_index.ann andpriv/clip_index_filenames.json files. To run the function, start the server usingrun mix phx.server and then run the function iniex shell usingMediaSearchDemo.Clip.build_index().

Using with Unsplash Sample Dataset (25,000 images)

  • Download the dataset fromhttps://unsplash.com/data/lite/latest.
  • Extract and copy thephotos.tsv000 file topriv directory. (You can directly download thephotos.tsv file fromhere without downloading the whole dataset).
  • Run the scriptdownload_unsplash_dataset.ex byrun elixir priv/scripts/download_unsplash_dataset.ex to download the images from the dataset. It will concurrently download images topriv/images directory.
  • Once the images are downloaded topriv/images directory, you have two options:
    1. Follow the steps inUsing with Your Images section to create an index from the 25k Unsplash images. (will take some time)
    2. Download the pre-built index files fromhere andhere and save both topriv directory.

How does it work?

  • The application uses theCLIP model with Bumblebee and Nx to create an index of images and then search the index for related images.
  • For more details, please check the talk slides. Slides can be foundhere

About

A demo application that uses the CLIP model for natural language media search (searching images with text, and searching related images with an image).

Resources

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp