yizhiwang96 / deepvecfont

[SIGGRAPH Asia 2021] DeepVecFont: Synthesizing High-quality Vector Fonts via Dual-modality Learning
MIT License
182 stars 31 forks source link

Structure of train_all.pkl #13

Closed rsinghal04 closed 2 years ago

rsinghal04 commented 2 years ago

I am using the dataset for clustering and could not understand the structure of cur_glyph['class'] in dataloader.py. I want to extract each glyph and its class labels. Can some guide me?

yizhiwang96 commented 2 years ago

I am using the dataset for clustering and could not understand the structure of cur_glyph['class'] in dataloader.py. I want to extract each glyph and its class labels. Can some guide me?

Hi rsinghal04,

cur_glyph['class'] should be an array of [0, 1, 2, ..., opts.char_categories-1] (opts.char_categories = 52 in our experiments: a-z, A-Z) cur_glyph is a collection of a single font, for example: cur_glyph['class'][0] = 0, cur_glyph['rendered'][0] is the image of 'A', cur_glyph['sequence'][0] is the drawing commands of 'A' ; cur_glyph['class'][26] = 26, cur_glyph['rendered'][26] is the image of 'a', cur_glyph['sequence'][26] is the drawing commands of 'a'.

Naming cur_glyph as cur_font would be better, sorry. You can print the data and its shape to see its structure.