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

Bug in run bash script #2

Closed Teera21 closed 9 months ago

Teera21 commented 12 months ago

image I run this in google colab and i get error in bash file, how can i do it for try this model.

VamosC commented 12 months ago

Hi, thx for your trial.

Maybe you can change https://github.com/VamosC/CLIP4STR/blob/a9f209a3c019d740f55bcb394a97f1ee720dae15/scripts/read.sh#L10 to an absolute path such as

/content/CLIP4STR/read.py
Teera21 commented 12 months ago

I solved it as you said but there are still many other problems.

I use Colab because I can download large models with my own computer resources and cannot run them.

I will be very grateful If you can share your GitHub running notebook (in colab) files to try out this model.

Thank you in advance. If it doesn't bother you too much.

VamosC commented 12 months ago

Hi, Teera21~

Thx for your interest in this repo. Recently I am busy with some other projects. The colab notebook may come later.

I think the first problem is the directory. Please recheck [Prepare data] in the ReadMe.

I use many relative paths in the project. Before running, make sure the paths are all correct. An absolute path may help you in some cases.

Feel free to raise any question~ I will answer it ASAP.

Teera21 commented 11 months ago

hi... To this day, I still haven't tried it, so sad.

VamosC commented 11 months ago

hi... To this day, I still haven't tried it, so sad.

Ok, that is a sad story.

Recently I am catching the deadline of CVPR. Give me some time~:cry:

VamosC commented 10 months ago

@Teera21

!git clone https://github.com/VamosC/CLIP4STR.git
!pip install -r /content/code/clip4str/requirements.txt

!wget https://openaipublic.azureedge.net/clip/models/5806e77cd80f8b59890b7e101eabd078d9fb84e6937f9e85e4ecb61988df416f/ViT-B-16.pt
!mv ViT-B-16.pt /content/pretrained/clip

!wget https://github.com/VamosC/CLIP4STR/releases/download/1.0.0/clip4str_base16x16_d70bde1f2d.ckpt
!mv clip4str_base16x16_d70bde1f2d.ckpt output

!bash code/clip4str/scripts/read.sh 0 clip4str_base16x16_d70bde1f2d.ckpt /content/code/clip4str/misc/test_image

image

It should work like this. PLZ carefully set your directories. Then changes ALL /PUT/YOUR/PATH/HERE in the project to a right one.

Teera21 commented 10 months ago

Thank you. Your are very amazing. I will try to run this.

ในวันที่ พ. 22 พ.ย. 2023 18:38 Chao Liang @.***> เขียนว่า:

!git clone https://github.com/VamosC/CLIP4STR.git !pip install -r /content/code/clip4str/requirements.txt

!wget https://openaipublic.azureedge.net/clip/models/5806e77cd80f8b59890b7e101eabd078d9fb84e6937f9e85e4ecb61988df416f/ViT-B-16.pt !mv ViT-B-16.pt /content/pretrained/clip

!wget https://github.com/VamosC/CLIP4STR/releases/download/1.0.0/clip4str_base16x16_d70bde1f2d.ckpt !mv clip4str_base16x16_d70bde1f2d.ckpt output

!bash code/clip4str/scripts/read.sh 0 clip4str_base16x16_d70bde1f2d.ckpt /content/code/clip4str/misc/test_image

[image: image] https://user-images.githubusercontent.com/26076544/284890350-34c984d7-11cd-4060-b96a-4ed6ca8a112a.png

It should work like this. PLZ carefully set your directories. Then changes ALL /PUT/YOUR/PATH/HERE in the project to a right one.

— Reply to this email directly, view it on GitHub https://github.com/VamosC/CLIP4STR/issues/2#issuecomment-1822608565, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUH34TNZPBIRU274XPGLJATYFXP37AVCNFSM6AAAAAA5YQFB6WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRSGYYDQNJWGU . You are receiving this because you authored the thread.Message ID: @.***>

Teera21 commented 10 months ago

image i try to you recomend but is still to bug

image

i set all config this from you same folder. what i wrong give me some you provide please.

image image image image

VamosC commented 10 months ago

Hi, @Teera21

Do you change this line https://github.com/VamosC/CLIP4STR/blob/a9f209a3c019d740f55bcb394a97f1ee720dae15/strhub/models/vl_str/system.py#L22

Besides, clip_pretrained in vl4str.yaml (your last image) should be the path of clip model, not the checkpoint of CLIP4STR.

Global search the phrase /PUT/YOUR/PATH/HERE to see what you need to do.

Teera21 commented 10 months ago

finally is Successs!!! Thank you very much!!! hahaha

image

Chao Liang

VamosC commented 10 months ago

Happy to see that!

VamosC commented 9 months ago

Close due to inactivity. Feel free to re-open.