wybertwang's picture
Upload 78 files
c426a27
raw
history blame
513 Bytes
from .blip import BLIPCaptioner
from .blip2 import BLIP2Captioner
from .git import GITCaptioner
from .base_captioner import BaseCaptioner
def build_captioner(type, device, args=None):
if type == 'blip':
return BLIPCaptioner(device, enable_filter=args.clip_filter)
elif type == 'blip2':
return BLIP2Captioner(device, enable_filter=args.clip_filter)
elif type == 'git':
return GITCaptioner(device, enable_filter=args.clip_filter)
else:
raise NotImplementedError("")