Giter VIP home page Giter VIP logo

Comments (9)

XuyangPan avatar XuyangPan commented on June 12, 2024 1

@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.

8uos avatar 8uos commented on June 12, 2024

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.

XuyangPan avatar XuyangPan commented on June 12, 2024

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.

XuyangPan avatar XuyangPan commented on June 12, 2024

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.

8uos avatar 8uos commented on June 12, 2024

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.

XuyangPan avatar XuyangPan commented on June 12, 2024

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.

XuyangPan avatar XuyangPan commented on June 12, 2024

I used data directory and default configuration to trained mxfont model. The trained result was in following:
1620726400(1)

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.

1620726944(1)
1620726970(1)
1620726992(1)

from mxfont.

SanghyukChun avatar SanghyukChun commented on June 12, 2024

@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.

SanghyukChun avatar SanghyukChun commented on June 12, 2024

Closing the issue, assuming the problem is resolved.
Please re-open the issue as necessary.

from mxfont.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.