

KeyBERT penguins skiing snowy, 0.9217 penguins skiing, 0.8879 skiing snowy, 0.6593 skiing snowy mountain, 0.643 penguins, 0.6079 PKE penguins skiing, 0.5 snowy mountain, 0.5Īlthough KeyBERT came up with more candidate keyphrases, some of them, like “penguins skiing snowy” are nonsensical. Here is a comparison of the keyphrases with scores extracted from “penguins skiing down a snowy mountain” with the two systems. For example, PKE allowed me to specify the parts of speech for the keywords (nouns, adjectives, and verbs.) After experimenting with both packages a bit, I found that PKE seems to do a better job.

Unlike past projects where I used KeyBERT to extract keywords and phrases from the text, I switched to using a package called Python Keyphrase Extraction (PKE). Here are descriptions of the components and processes used in CLIP and PASTE. You can see how the art form progressed from including pasted newspaper clippings on canvases with paint and pencil drawings to compositions made solely by arranging cutouts of photographs. Here are some samples of early photo collages, shown chronologically clockwise from the top, left.Ĭlockwise from top left, Still Life with Advertisement, 1913, Pablo Picasso, Glasses and Bottles (Furs), Georges Braque, 1914, Cut with a Kitchen Knife through the Last Weimar Beer-Belly Cultural Epoch of Germany, 1919, Hannah Höch, Collage with Girls, Athletes, and Clowns, 1925, Alexander Rodchenko, Le Critique d’art, 1920, Raoul Hausmann, All Images are in the Public Domain Since that moment, the story goes, artists have used the act of snipping and sticking as a means of bringing the world around us into unexpected, transformative combinations on canvas. The word - from the French verb coller, meaning “to stick” - was first used to describe the Cubist innovations of Pablo Picasso and Georges Braque, who began to stick newspaper cuttings and other materials onto their canvases in 1912. The art of making photo collages, also known as photo montages, goes back over 100 years.Ĭollage is often thought of as an archetypally modern artistic technique. And you can create your own using the Google Colab here. Be sure to check out the appendix for more generated photo collages. You can read about the details of the system in the sections below. After 100 iterations, the final image is displayed. The system adjusts the positions of the image parts by iteratively analyzing and compositing the collage using the Adam optimizer in Pytorch. The layouts are run through CLIP to find the best one. I built a custom image compositor that randomly assembles the pieces into multiple photo collages. The cutouts are rerun through CLIP to find the image parts that best match the keywords. The system runs the top images through the GRoIE image segmentation model to create cutouts from the photos. Next, the system downloads the top 100 images from Wikimedia Commons and OpenImages and runs them through the CLIP Image Encoder, again comparing them to the keywords. For OpenImages, I use the CLIP Text Encoder to find the best text match by comparing the embeddings from the keywords and the descriptions. I use the Wikimedia Search API to find potentially matching images. It then searches for images from Wikimedia Commons and OpenImages that match the keywords in the prompt. The process starts with a text prompt, like “penguins skiing down a snowy mountain.” The system uses the Python Keyphrase Extraction library to pull out keywords. CLIP and PASTE Component Diagram, Diagram by Author
