Semantic Filtering Templates
Semantic filtering is a way to provide a filtering effect on a set of images without the need for any metadata to filter on.
It is important to remember how models are trained. CLIP models are trained on captioned images, this means that the best search results typically come from queries that resemble a caption. For example a search for an image of a dog
will typically return better results than dog
. A great example of this can be seen in how prompting is done for zero-shot classification with CLIP models in this notebook
This concept can be taken a step further and we can use semantic filtering to provide a filtering effect with just images.
Semantic Filtering is Like Prompt Engineering
Prompt engineering has become popular with the rise of Large Language Models (LLMs). Semantic filtering is a very similar process whereby you aim to take some task like searching for a dog and tune the query to give more specific or better behaviour, like searching for a dog in a cartoon style.
Recipe for Semantic Filtering Templates
Below we provide a number of templates which can be used in a variety of domains. To use these, simply replace the <QUERY>
with your search term. For example, a search for dog
with the template "An image of a <QUERY> set in a neon-lit, futuristic cyberpunk world"
would become "An image of a dog set in a neon-lit, futuristic cyberpunk world"
.
Stock Image / Generic Image Semantic Filtering Templates
{
"photorealistic": "A high-resolution, lifelike stock photo of a <QUERY>",
"stylized": "An image of a <QUERY> rendered in a unique, stylized manner",
"lowpoly": "A 3D low polygon angular render of a <QUERY>",
"artistic": "An image resembling a masterpiece, portraying a <QUERY>",
"cartoon": "An image in the style of Saturday morning cartoons featuring a <QUERY>",
"abstract": "An image inspired by modern art, abstractly representing a <QUERY>",
"pixelart": "An 8-bit or 16-bit pixel art representation of a <QUERY>",
"vector": "A clean, scalable vector graphic of a <QUERY>",
"minimalistic": "A photo emphasizing simplicity and minimalism, showing a <QUERY>",
"grayscale": "A black and white, monochromatic image of a <QUERY>",
"vintage": "An image of a <QUERY> with a retro or vintage aesthetic",
"cyberpunk": "An image of a <QUERY> set in a neon-lit, futuristic cyberpunk world",
"steampunk": "An image blending Victorian and industrial elements, depicting a <QUERY>",
"realism": "A hyper-realistic, detailed image of a <QUERY>",
"impressionist": "An image mimicking the impressionist art movement, showing a <QUERY>",
"surreal": "A surreal, dream-like image of a <QUERY>",
"sketch": "A hand-drawn sketch or pencil drawing of a <QUERY>",
"popart": "An image in the style of pop art, featuring a <QUERY>",
"watercolor": "A watercolor painting-like image of a <QUERY>",
"oilpaint": "An oil painting-like image, rich in texture, of a <QUERY>",
"glitch": "A glitch-art styled, distorted image of a <QUERY>",
"neon": "An image of a <QUERY> with vibrant, neon colors",
"noir": "A film-noir inspired, high-contrast image of a <QUERY>",
"fantasy": "A fantastical, otherworldly image of a <QUERY>",
"comic": "An image resembling a comic book panel, featuring a <QUERY>",
"isometric": "An isometrically projected image of a <QUERY>",
"outline": "An outline line art depiction of a <QUERY>",
}
E-commerce Semantic Filtering Templates
{
"bright": "A brightly lit, high-resolution image of a <QUERY>",
"bohemian": "An image of a <QUERY> with a bohemian style, emphasizing free-spirited aesthetics",
"colorful": "An image of a <QUERY> featuring a wide range of colors, appealing to diverse tastes",
"formal": "An elegantly presented image of a <QUERY>, suitable for formal contexts",
"dynamic": "A dynamic, action-oriented photo of a <QUERY>, emphasizing its use in real-life situations",
"lifestyle": "A lifestyle image of a <QUERY>, showing it in a realistic setting or being used",
"60s": "An image of a <QUERY> with 1960s style, showcasing mid-century modern aesthetics",
"retro": "A retro-inspired image of a <QUERY>, with a nod to past decades",
"closeup": "A close-up, detailed image of a <QUERY>, highlighting textures and quality",
"minimalist": "An image of a minimalist <QUERY>, focusing on clean lines and simplicity",
"vibrant": "A photo of a <QUERY> with saturated, vibrant colors to catch the customer's eye",
"textured": "A detailed image showing the texture of a <QUERY>, giving a sense of material",
}
Fashion Semantic Filtering Templates
{
"streetwear": "An image showcasing a <QUERY> in a streetwear style, perfect for urban fashion",
"high_fashion": "A high-fashion, editorial image of a <QUERY>, emphasizing luxury and trend-setting designs",
"comfy": "A cozy, comfortable-looking image of a <QUERY>, ideal for casual wear",
"summer_fashion": "A summer-inspired image of a <QUERY>, light and perfect for warm weather",
"winter_fashion": "A winter-themed image of a <QUERY>, highlighting warmth and layering",
"vintage_fashion": "A retro-styled image of a <QUERY>, with a vintage or nostalgic flair",
"runway": "A runway image of a <QUERY>, capturing the essence of high fashion shows",
"bohemian": "An image of a <QUERY> with a bohemian style, emphasizing free-spirited aesthetics",
"sporty": "A sporty, athletic image of a <QUERY>, suitable for active lifestyles",
"elegant": "An elegantly styled image of a <QUERY>, perfect for formal occasions",
"casual": "A casual, everyday image of a <QUERY>, for a relaxed look",
"avant_garde": "An avant-garde, boundary-pushing image of a <QUERY>, for cutting-edge styles",
}
Furniture and Interior Design Semantic Filtering Templates
{
"modern": "A modern style image of a <QUERY>, showcasing contemporary design trends",
"traditional": "A traditional style image of a <QUERY>, with classic details and timeless appeal",
"minimalist": "A minimalist image of a <QUERY>, emphasizing clean lines and simplicity in design",
"scandinavian": "A Scandinavian style image of a <QUERY>, highlighting functionality, simplicity, and craftsmanship",
"industrial": "An industrial style image of a <QUERY>, with a focus on raw materials and sleek lines",
"boho": "A bohemian (boho) style image of a <QUERY>, rich in patterns, colors, and textures",
"rustic": "A rustic style image of a <QUERY>, emphasizing natural beauty and ruggedness",
"luxury": "A luxury image of a <QUERY>, depicting opulence and high-end design",
"eclectic": "An eclectic style image of a <QUERY>, mixing various styles and periods for a unique look",
"art_deco": "An Art Deco style image of a <QUERY>, featuring bold geometric patterns and luxurious materials",
}