Comments (9)
@SanghyukChun @8uos
many thanks to you.
With the help of your kind reply, I figured out application scenario of mxfont model and how to generate target character image.
Hope you enjoy your life.
from mxfont.
Hi, thanks for your interest in our work.
The truetype font files (.ttf) and decomposition information file (.json) are needed to train the model.
Also, the file of available characters is needed for each ttf file and you can generate it automatically using the get_chars_from_ttf.py
.
Please refer readme for the detailed file format and the usage.
You can find the example data structure under the data
directory.
Thanks.
from mxfont.
I steped through the TTFTrainDataset(especially the function init() and getitem()) in the project code, and the some varaibles values were recorded. Their values were summarized in the following:
font : MaShanZheng-Regular.ttf, ZCOOLKuaiLe-Regular.ttf
character num: 6448
primals num: 371
decomposition num: 19739
data_list: [('MaShanZheng-Regular', 'δΈ'), ...], length: 12892
trg_img: a character image with font and character from one of data_list
trg_dec: corresponding character components
style_imgs: three character images with fonts and characters. Fonts are same with trg_img's, characters are different with trg_img's, and three character images are drawn with different characters
style_decs: corresponding character components
char_imgs: three character images with fonts and characters. Fonts are different with trg_img's, characters are same with trg_img's, and three character images are drawn with same characters
char_decs: corresponding character components
from mxfont.
Hi, thanks for your reply.
I want to use few-shot reference glyphs to train model for generating a personal font library. What confuses me is reference images that paper metioned . Figure 1 and Table 1 presenting results with using only four reference images, so I think there should be four style images as model input for training. But the code project was not like that as expected.
I red the paper and run the project code many times, wish good reply and proper explaination.
Many thanks.
from mxfont.
Hi, I think that you are trying to generate the glyph images from your own font file. Is it right?
Note that, our model is able to generate new fonts without additional training.
So, if you only want to generate glyphs, you don't have to train the model with reference images.
For the generation, 1) reference style images (.png), 2) a font file to use as source (.ttf), 3) character list to generate (.txt, optional) are needed.
Please refer here for detailed instruction.
Sorry for the confusion.
from mxfont.
Many thanks for your timely reply.
Provided that I have some my handwritten character images, it is by learning their features that the mxfont model finally can generate integral font library with my handwritten character features. Is it right?
So, I want to figure out how to train mxfont model with some my handwritten character images.
from mxfont.
I used data directory and default configuration to trained mxfont model. The trained result was in following:
In the evaluation, 300000.pth was used for model weights and Hanyi four style images were generated with Hanyi Senty Candy-color.ttf file (from https://www.sentyfont.com/candy.htm). The result went bad.
from mxfont.
@XuyangPan
Hi, thanks for your questions.
I presume that your purpose is only creating a new font with four references.
MX-Font aims to solve "few-shot font generation"; once you have a model, the model can generate a full font library with a few references without any fine-tuning.
If you want to create your own font using a few samples (as 4 characters in our paper), you don't have to train or fine-tune anything. But I presume that you train something (so you have 30000.pth) that is not correct way to use MX-Font inference. Please just follow https://github.com/clovaai/mxfont#test again for the details, and please check whether you correctly run eval.py
, not train.py
python eval.py \
cfgs/eval.yaml \
--weight generator.pth \
--result_dir path/to/save/images
from mxfont.
Closing the issue, assuming the problem is resolved.
Please re-open the issue as necessary.
from mxfont.
Related Issues (20)
- RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) HOT 2
- Why do the models I trained predict the same results in two folders HOT 2
- There is a problem with the predicted character image HOT 3
- Got nothing after test using eval.py HOT 2
- Can the model output .ttf file? HOT 1
- OSError: symbolic link privilege not held HOT 1
- Why are there significant differences between the images generated in training and those generated in test files HOT 2
- dataset
- got a blank image during inference
- How can I export an onnx model HOT 4
- Is the content and style classifier pre trained, or are they trained together with mxfont HOT 6
- Training Set Consultation HOT 3
- font_indice font_indice HOT 3
- Consult "B.5. Training details" in the paper
- When reducing the training set characters, an error is reported: HOT 3
- The Role of Factorize and Defactorize HOT 2
- Hello, I have trained our model and found that the generation effect of characters with complex strokes is not very good. Do you have any good suggestions
- What are the meanings of style_facts_s style_facts_c, char_facts_s and char_facts_c HOT 5
- Classifier
- single Gpu report Bug
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 mxfont.