VamosC / CLIP4STR

An implementation of "CLIP4STR: A Simple Baseline for Scene Text Recognition with Pre-trained Vision-Language Model".
Apache License 2.0
115 stars 14 forks source link

Error While Inferencing #18

Closed srinarayanaTantry closed 3 months ago

srinarayanaTantry commented 3 months ago

Hello @VamosC @mzhaoshuai

I am constantly Facing the same error of

File "/home/lincode/Documents/OCR/CLIP4STR-main/strhub/models/utils.py", line 110, in load_from_checkpoint ModelClass, experiment = _get_model_class(checkpoint_path) File "/home/lincode/Documents/OCR/CLIP4STR-main/strhub/models/utils.py", line 77, in _get_model_class raise InvalidModelError("Unable to find model class for '{}'".format(key)) strhub.models.utils.InvalidModelError: Unable to find model class for 'clip.ckpt'

i am not understanding on how to proceed. can anyone help me out. have renamed clip4str_base16x16_d70bde1f2d.pt as clip.pt

the command that i have given is (inside CLIP4STR cloned Folder)

python read.py clip.ckpt --images_path abspath/misc/test_image

thanks in advance. you guys are making me love AI more, thanks, One day Id like to implement papers like you guys , keep going.

mzhaoshuai commented 3 months ago

@srinarayanaTantry

Hi, you should not rename clip4str_base16x16_d70bde1f2d.pt as clip.pt. Just keep the name.

Besides, you need to download https://openaipublic.azureedge.net/clip/models/5806e77cd80f8b59890b7e101eabd078d9fb84e6937f9e85e4ecb61988df416f/ViT-B-16.pt and put it at https://github.com/VamosC/CLIP4STR/blob/d18f2f4b98b7e3dc1a59a845a6940997a4e9c09c/strhub/models/vl_str/system.py#L22

srinarayanaTantry commented 3 months ago

Hey @mzhaoshuai , thank you. Working Seamlessy now.