This guide demonstrates using embeddings for semantic photo search.
First, ensure we have the required model and directories.
# Register the model
llm sentence-transformers register all-MiniLM-L6-v2# Verify directories
ls -la ../data/images/jwalsh_* 2>/dev/null | wc -l || echo "Photo directory not found"
ls -la ../data/semantic-photos 2>/dev/null || echo "Semantic photos directory not found"Run the complete photo semantics demo script.
../scripts/photo-semantics.shTest specific semantic searches.
# Food-related searches
llm similar photo-semantics -c "japanese cuisine and sushi"llm similar photo-semantics -c "pasta dishes with vegetables"# Urban scenes
llm similar photo-semantics -c "city waterfront or harbor"# Documentation and UI
llm similar photo-semantics -c "technical documentation or user interface"# Lifestyle
llm similar photo-semantics -c "coffee shop and reading"Review embedding effectiveness.
# Check embedding collection info
llm collections list | grep photo-semantics
# Get embedding statistics
llm similar photo-semantics --info
# Check individual photo embeddings
for photo in ../data/semantic-photos/*.jpg; do
echo "Analyzing: $(basename $photo)"
llm similar photo-semantics -f "$photo" -n 2
echo "---"
doneExample of more complex queries.
llm similar photo-semantics -c "food photography with natural lighting"llm similar photo-semantics -c "modern urban architecture near water"llm similar photo-semantics -c "work environment with technology"llm similar photo-semantics -c "cars and transportation"llm similar photo-semantics -c "nature and landscapes"llm similar photo-semantics -c "portraits and people"- The demo uses the all-MiniLM-L6-v2 model for embeddings
- Photos are semantically renamed for better organization
- Results can vary based on the specific photos available
- Consider experimenting with different embedding models
Note: These examples require user interaction and are not suitable for automated execution.
# Interactive photo analysis
llm chat "Analyze this photo" --file ../data/semantic-photos/coffee_and_book.jpg