Multimodal_Demo / models /grit_model.py
Sirus1's picture
Duplicate from TencentARC/VLog
6f6830f
raw
history blame
No virus
636 Bytes
import os
from models.grit_src.image_dense_captions import image_caption_api
class DenseCaptioner():
def __init__(self, device):
self.device = device
def initialize_model(self):
pass
def image_dense_caption_debug(self, image_src):
dense_caption = """
1. the broccoli is green, [0, 0, 333, 325];
2. a piece of broccoli, [0, 147, 143, 324];
3. silver fork on plate, [4, 547, 252, 612];
"""
return dense_caption
def image_dense_caption(self, image_src):
dense_caption = image_caption_api(image_src, self.device)
return dense_caption