Google Colab notebook:

Unsplash Image Search

Using this notebook you can search for images from the Unsplash Dataset using natural language queries. The search is powered by OpenAI’s CLIP neural network.

This notebook uses the precomputed feature vectors for almost 2 million images from the full version of the Unsplash Dataset. If you want to compute the features yourself, see here.

This project was created by Vladimir Haltakov and the full code is open-sourced on GitHub.

Unsplash license.

Steps to follow to do your first search in a given Colab session:

  1. Click this link.

  2. Sign into your Google account if you’re not already signed in. Click the “S” button in the upper right to do this. Note: Being signed into a Google account has privacy ramifications, such as your Google search history being recorded in your Google account.

  3. Click somewhere (except the triangle) in the cell with the line that reads ‘search_query = “Two dogs playing in the snow”‘.

  4. Click menu item “Runtime->Run before”. Wait until execution stops.

  5. Find the line that reads (or initially read) ‘search_query = “Two dogs playing in the snow”‘. Change “Two dogs playing in the snow” to your desired search query (include the quotes); example: ‘search_query = “A clock with gold-colored numbers on a black background”‘.

  6. (Optional) Find the line that reads (or initially read) ‘search_unslash(search_query, photo_features, photo_ids, 3)’. Change 3 in that line to the number of search results that you want.

  7. Click the triangle to the left of the line that initially read ‘search_query = “Two dogs playing in the snow”‘. Wait for the search results.

Steps to follow to do more searches in a given Colab session: Do steps 5 to 7 above.

After you’re done with your Google Colab session, optionally log out of your Google account due to the privacy ramifications of being logged into a Google account.

Update: Text from the notebook:

WARNING ⚠️ Since many people are currently using the notebook, it seems that the Unsplash API limit is hit from time to time (even with caching in the proxy). I applied for production status which will solve the problem. In the meantime, you can just try when a new hour starts. Alternatively, you can use your own Unsplash API key

Info about OpenAI’s CLIP.

I am not affiliated with this project or its developer.

Example of a search result for query “A clock with gold-colored numbers on a black background”:

Post image





Source link

Write A Comment