https://github.com/leeyunjai/image2text
caption generator using lavis and argostranslate
https://github.com/leeyunjai/image2text
blip2 caption caption-generation caption-generator captioning-images captions image-analysis image-text img2txt
Last synced: 4 months ago
JSON representation
caption generator using lavis and argostranslate
- Host: GitHub
- URL: https://github.com/leeyunjai/image2text
- Owner: leeyunjai
- Created: 2023-03-20T06:01:14.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-21T01:11:20.000Z (over 2 years ago)
- Last Synced: 2025-04-10T17:41:51.260Z (7 months ago)
- Topics: blip2, caption, caption-generation, caption-generator, captioning-images, captions, image-analysis, image-text, img2txt
- Language: Python
- Homepage:
- Size: 128 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# image2text
caption generator using lavis, argostranslate.
deploy gradio.
pip3 install -r requirements.txt
python3 main.py
If you want to use GPU, Edit main.py
# main
cap = captionModel("cpu") ## cuda
trans = translateModel("cpu") ## cuda
demo.launch(share=True)
If you want to change caption model, Edit caption.py
# blip
#model, vis_processors, _ = load_model_and_preprocess(name="blip_caption", model_type="large_coco", is_eval=True, device=device)
# blip2 coco_opt2.7b
self.model, self.vis_processors, _ = load_model_and_preprocess(name="blip2_opt", model_type="caption_coco_opt2.7b", is_eval=True, device=self.device)
# blip2 coco_opt6.7b
self.model, self.vis_processors, _ = load_model_and_preprocess(name="blip2_opt", model_type="caption_coco_opt6.7b", is_eval=True, device=self.device)
