Comments (7)
from lffont.
Hi, I have checked the code and tested it, but there was no error.
A possible mistake is calling dataset directly in multiple times, like this:
dset = FactTrainDataset(...)
in_style_ids = dset[0][0]
trg_style_ids = dset[0][3]
...
Because the output of dataset.__getitem__
changes every time you call it(because of random sampling), please modify the code like this:
dset = FactTrainDataset(...)
batch = dset[0]
in_style_ids = batch[0]
trg_style_ids = batch[3]
...
or use the Dataloader defined in datasets/__init__.py
Sorry for the inconvenience.
from lffont.
Thank you for your reply。I mean that in the p2dataset.py,
first, through the code on 122 line(self.sample_input(self.n_in_chars)),in_fonts will have three styles fonts(because self.n_in_chars = 3),
then in self.check_and_sample (...), the code on 113 line(trg_fonts = self.get_available_fonts(trg_unis, in_fonts)), for trg_unis, trg_fonts are random chosed based code on 55 line (avail_font = random.choice(avail_fonts)),.I think the operation will cause that trg_imgs possibly don't match to in_fonts.
for example:
in_fonts are ["fontA", "fontB", "fontC"], fontA include a component compA, fontB include a component compB, fontC include a component compC,
but trg_imgs(s.t compnent imgs) possibly occur that compA represent the style of fontB, not represent the style of fontA.
is it right? Thank you.
from lffont.
I understood. It is right, not a bug.
In phase 2, we aim to train the model to build new component-styles not included in input images("compA represent the style of fontB" of your example) through factorizing and combining the component-styles included in input images("compA represent the style of fontA ..." of your example).
So, what you are worrying about is what we intended to.
The detailed process is described in Section 3.3 of our paper.
Thanks for the question.
from lffont.
OK, thank you. In other words, in phase1 trg_imgs match to in_fonts, in phase2 may not match to in_fonts.
In your paper, the generated Style interpolation graphs is good, how is it generated?
from lffont.
@clscy
I presume you mean the style interpolation figure (Fig 10, below)
We followed many previous style transfer literature for the style interpolation (e.g., AdaIN https://arxiv.org/abs/1703.06868)
More precisely, we generate the interpolated samples by
Decoder(content_features, content_factors, interpolated_style_factors)
wherecontent_features = ContentEncoder(content_glyph)
content_factors = StyleEncoder_ContentFactorDecomposed(content_glyph, target_components)
style_factors = StyleEncoder_StyleFactorDecomposed(reference_glyphs, reference_components)
interpolated_style_factors = lambda * style_factors_1 + (1 - lambda) style_factors_2
, here lambda is between 0 and 1 (the figure shows the uniform lambda range), and style_factors_1 and style_factors_2 are from the most left / right fonts, respectively.
from lffont.
Ok, thank you.
from lffont.
Related Issues (20)
- Style transfer for a single font HOT 7
- how to "Build meta file to dump lmdb environment" and how to "python build_dataset.py "? HOT 2
- During training, the model stops at "Start training..." HOT 13
- lmdb_path HOT 7
- Training interrupted by validation HOT 10
- Question about p1dataset.py HOT 2
- Pre-trained model for Korean fonts generation HOT 2
- The label number of the chn_decomposed HOT 8
- Question about training
- How to use the data produced by the build_dataset.py file during training HOT 9
- Question about the classfiers for calculating FID ACC(S) and ACC(C) HOT 3
- Hello, may I ask how to process data when using images as training sets in LFFont? HOT 1
- KeyError: '71FC' HOT 3
- IndexError: list index out of range HOT 4
- ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (27, 2) + inhomogeneous part. HOT 4
- Question about korean generator HOT 2
- 数据集 HOT 1
- data set HOT 1
- data set HOT 4
- about phase 1 training HOT 2
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 lffont.