img_txt2 / warm_up.py
next-social's picture
Duplicate from next-social/img_txt
e5c992e
raw
history blame contribute delete
439 Bytes
from typing import List
from ocr import get_ocr_model
def warm_up(langs: List[str]):
# Load the model
model = get_ocr_model(langs)
# Load the image
result = model.readtext('img.png')
print(result)
if __name__ == '__main__':
warm_up(['en', 'zh-CN'])
# 'fr', 'es', 'de', 'ru', 'ja', 'ko'
warm_up(['fr'])
warm_up(['es'])
warm_up(['de'])
warm_up(['ru'])
warm_up(['ja'])
warm_up(['ko'])