Social Media Caption Generation Llama3 2 11B
Social Media posts Caption generation using Llama-3.2 Vision
Thinking fancy captions for social media is boredom. Newly released Llama3.2 that supports image reasoning can do this task quite easily, This example notebook demonstrates it.
In this example, we'll use conceptual_captions dataset by Google Research. Image descriptions in the dataset are mainly utilized for searching relevant image and then utilizing the resultant image as an social media image for which we'll be generating fancy social media caption.
Preprocessing dataset
0
Setup LanceDB
[2024-09-26T19:35:55Z WARN lance::dataset] No existing dataset at /Users/lei/tmp/lancedb/conceptual_caption.lance, it will be created
Link in first result is dead, trying next using image from result 1
Load model from Huggingface
NOTE: You'll need to agree to terms for using model from HF.
huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks... To disable this warning, you can either: - Avoid using `tokenizers` before the fork if possible - Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)
VBox(children=(HTML(value='<center> <img\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.sv…
Here are the social media post captions generated by Llama3.2-11B-Vision model
Here are some fancy captions you could use for each image:
- "A night to remember at the FX Justified premiere!"
- "Red carpet ready with my fellow cast members!"
- "The cast of Justified looking sharp at the premiere!"
- "A glimpse into the world of Justified!"
- "The stars of Justified shine bright on the red carpet!"
- "A night of drama and excitement at the Justified premiere!"
- "The talented cast of Justified brings the show to life!"
- "A behind-the-scenes look at the Justified premiere!"
- "The glamour of the Justified premiere!"
- "A night to remember with the cast of Justified!"
These captions are designed to be attention-grabbing and engaging, and can help to increase the visibility and reach of your images on social media. Feel free to customize them to fit your personal style and the tone of your post.