Comments (7)
your code doesn't match image, not clear what is model
from mltu.
This trained model is not predicting my images sir.
show your code, how you do this prediction, because I can't tell why without code...
from mltu.
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])
image_pred = np.expand_dims(image, axis=0).astype(np.float32)
preds = self.model.run(None, {self.input_name: image_pred})[0]
text = ctc_decoder(preds, self.char_list)[0]
return text
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}")
from mltu.
what was your CER while training model on validation data, I think your model was not trained
from mltu.
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.
from mltu.
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 [email protected]
from mltu.
I can give you $$ but how much? I need to crack all images of this type.
from mltu.
Related Issues (20)
- Tutorial 2 - ModuleNotFoundError: No module named 'mltu' HOT 8
- Config file issue HOT 3
- config.yaml HOT 2
- Empty model folder HOT 1
- Saving and Loading model errors HOT 7
- model.onnx file is not creating HOT 5
- captcha images name issue for training HOT 2
- Impossible to solve contradiction in dependencies on Mac M1. HOT 3
- Failed to find data adapter that can handle input HOT 11
- Epoch 11: val_CER did not improve from 1.00000 HOT 3
- mltu/transformer.py SpectrogramPadding Bag. HOT 2
- no module named tf2onnx HOT 8
- No module named mltu
- I want to increase learning_rate and train_workers, is that possible? HOT 18
- train.py giving error on custom dataset HOT 19
- Transcription has no stops between sentences. HOT 8
- about your augmentators ultility HOT 1
- Compatibility Issue with Protobuf Versions in TensorFlow ONNX Conversion HOT 1
- Dropout with Batch Normalization Disharmony HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mltu.