You remember a red suitcase in a photo, but the files are all called IMG_1001 and similar names. This small local experiment lets you type a red suitcase and look through the three closest images. It uses CLIP to compare the text with the pictures, so you can leave the filenames alone.
The example album has six AI-created images. There are red, blue and orange suitcases, a red backpack, a red mug and a cactus. Keeping the set small makes it easy to see which part of your description the search has picked up.
The six-image sample album. All object images are AI-created illustrations.
Run the included Gradio app and leave a red suitcase in the text box. Click Search. In the CPU test, the red suitcase came first, followed by the orange suitcase and the red backpack. The scores were about 0.319, 0.274 and 0.274.
Actual local Gradio output from the six-image album.
The orange case shares the shape of the target. The backpack shares its colour and its role as luggage. Look at the pictures before deciding which file to open. The numbers order the candidates in this album. A score of 0.319 does not establish a 31.9% chance that the picture is the one you wanted.
Select Remove the red suitcase from this search and click Search again. The top three become the orange suitcase, red backpack and blue suitcase. There is still a result list, even though the exact requested object is gone. Actual local output after removing IMG_1001. Similarity still produces a ranked list.
That is a useful check before trying a larger folder. A nearest-image search will return something when it has candidates. Keep the gallery visible so you can reject a plausible-looking result. For these six pictures, the missing-target switch makes the limitation easy to reproduce. Other images and descriptions will need their own checks.
The example folder contains search_photos.py, app.py, the six images and the dependency file. With Python 3.12, create an environment, install requirements.txt, then run python app.py in that environment. Open the local address printed in the terminal. The first run downloads the model.
The implementation loads openai/clip-vit-base-patch32 through Transformers. It produces an embedding for each picture and for the query. The image and text embeddings returned by CLIP are normalized, so their dot product gives cosine similarity. The app sorts those scores and displays the first three original files. Filenames are labels for the results and do not enter the model.
For a terminal-only check, run `python search_photos.py "a red suitcase"`. A blank query or an empty candidate list returns an empty result. Start with your own permitted small sample if you replace the pictures, and inspect the returned files yourself.
If the aim is to make a short travel clip, open the chosen photograph and find another compatible view of the same subject. Check that the crop, object and lighting work together. A search ranking alone cannot establish whether two images will make good endpoints.
OpenMaker’s free image-to-video tool offers a separate manual step for trying two endpoint images and a motion description. The search app does not call that tool. The six bundled illustrations are search examples rather than a matched pair for animation.
The actual local run used Python 3.12.14, PyTorch 2.6.0, Transformers 4.49.0 and Gradio 5.25.2 on macOS arm64, with CLIP on CPU. The model card describes CLIP as a research output. This small album check has no public Space or general photo-library accuracy result.
Disclosure: This example includes an optional OpenMaker workflow. AI assisted with the writing and original sample illustrations.