Skip to content

caption generator using lavis and argostranslate

Notifications You must be signed in to change notification settings

leeyunjai/image2text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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