-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use the trained model? #2
Comments
If the trained CNN model is saved as import torch
cnn_net = torch.load('../data/models/cnn_model.torch')
img = Image.open(img_path)
img = img.copy().convert("L")
label = cnn_net(img) The |
Do you have pre-trained model? I tried https://github.com/HemingwayLee/deepfont-implement, and the result seems not correct for Japanese fonts. |
I have trained a toy model for Japanese fonts months ago. You can download the model here. It can only recognize the following five fonts. You can download the fonts here.
I have refactored my code and I am currently trying to train a larger model which can recognize 169 Japanese fonts. I may release it soon. |
Good. Will wait for your large model to test. |
import torch cnn_net = torch.load('../data/models/cnn_model.torch')from PIL import Image cnn_net = torch.load(r'L:/font/cnn_model.torch') img = Image.open(img_path)img = Image.open(r'F:/24.png') label = cnn_net(img) 报错=========================================== D:\Python3.8.8\python.exe F:/pycharm2020.2/universal-font-recognition-main/eval.py
Process finished with exit code 1 |
No description provided.
The text was updated successfully, but these errors were encountered: