You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
Model ended training with Epoch 51: early stopping
. I am training with dataset 1040 images? I am training with my 1040 labled images given below but when I try to predict text it shows empty string.
Code ::
image = cv2.imread('./6wf4ef.jpg')
prediction_text = model.predict(image) // return empty string
print(f"Predicted Text: {prediction_text}")
when I run train.py, it stopped training after sometime and give this message Epoch 51: early stopping and after that when I try to predict image. it did not predict. Below 3 lines I added, it worked with different data set nut not with this.
import cv2
import typing
import numpy as np
from mltu.inferenceModel import OnnxInferenceModel
from mltu.utils.text_utils import ctc_decoder, get_cer
Yes, I can train you a model for $$. Otherwise, I can't train a model for everyone. If you are interested write me an email to pythonlessons0@gmail.com
Activity
pythonlessons commentedon Aug 6, 2023
your code doesn't match image, not clear what is model
pythonlessons commentedon Aug 6, 2023
show your code, how you do this prediction, because I can't tell why without code...
Zain-ul-abdin0 commentedon Aug 6, 2023
when I run train.py, it stopped training after sometime and give this message Epoch 51: early stopping and after that when I try to predict image. it did not predict. Below 3 lines I added, it worked with different data set nut not with this.
import cv2
import typing
import numpy as np
from mltu.inferenceModel import OnnxInferenceModel
from mltu.utils.text_utils import ctc_decoder, get_cer
class ImageToWordModel(OnnxInferenceModel):
def init(self, char_list: typing.Union[str, list], *args, **kwargs):
super().init(*args, **kwargs)
self.char_list = char_list
def predict(self, image: np.ndarray):
image = cv2.resize(image, self.input_shape[:2][::-1])
if name == "main":
import pandas as pd
from tqdm import tqdm
from mltu.configs import BaseModelConfigs
configs = BaseModelConfigs.load("./Models/02_captcha_to_text/202308060003/configs.yaml")
model = ImageToWordModel(model_path=configs.model_path, char_list=configs.vocab)
df = pd.read_csv("./Models/02_captcha_to_text/202308060003/val.csv").values.tolist()
accum_cer = []
for image_path, label in tqdm(df):
image = cv2.imread(image_path)
prediction_text = model.predict(image)
cer = get_cer(prediction_text, label)
print(f"Image: {image_path}, Label: {label}, Prediction: {prediction_text}, CER: {cer}")
accum_cer.append(cer)
image = cv2.imread('./6wf4ef.jpg')
prediction_text = model.predict(image)
print(f"Predicted Text: {prediction_text}")
pythonlessons commentedon Aug 7, 2023
what was your CER while training model on validation data, I think your model was not trained
Zain-ul-abdin0 commentedon Aug 8, 2023
is your model is able to be train from this data below , and if I share path to my labeled folder. May you please train your model on my data.
pythonlessons commentedon Aug 8, 2023
Yes, I can train you a model for $$. Otherwise, I can't train a model for everyone. If you are interested write me an email to pythonlessons0@gmail.com
zainulabdinsystems commentedon Aug 11, 2023
I can give you $$ but how much? I need to crack all images of this type.
