Downloads · 30 days
0
alcaitiff/LLM-CAPTION
LLM-CAPTION is a machine learning model from alcaitiff. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This Python CLI script generates caption files for all images within a specified folder. It saves the captions using the same filename as the corresponding image, with a .txt extension, either in the same folder or in…
Downloads · 30 days
0
Access
Public
Updated Dec 6, 2024
Repo size
2.5 GB
Likes
5
Public
Click a slice to open those files.
.pt1.8 GB · 73%
From the Hugging Face model README
This Python CLI script generates caption files for all images within a specified folder. It saves the captions using the same filename as the corresponding image, with a .txt extension, either in the same folder or in the directory specified by the output_dir argument. The script will not create captions for images that already have a corresponding caption file in the output_dir.
This project is not original but an adaptation from several other projects from https://huggingface.co/fancyfeast , https://huggingface.co/John6666 and https://huggingface.co/Wi-zz
python3 -m venv ./venv
source venv/bin/activate
pip install -r requirements.txt
#EX1
python3 ./caption.py ./test
#EX2
python3 ./caption.py ./test \
--prompt "Describe this image in detail within 50 words." \
--output_dir /tmp/caption
In one paragraph, write a very descriptive caption for this image, describe all objects, characters and their actions, describe in detail what is happening and their emotions. Include information about lighting, the style of this image and information about camera angle within 200 words. Don't create any title for the image.