An open API service indexing awesome lists of open source software.

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

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)


![bg](bg.png)