Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 870 Bytes

README.md

File metadata and controls

33 lines (26 loc) · 870 Bytes

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