{"id":19731681,"url":"https://github.com/clovaai/fewshot-font-generation","last_synced_at":"2025-04-09T14:15:09.367Z","repository":{"id":37300474,"uuid":"424837351","full_name":"clovaai/fewshot-font-generation","owner":"clovaai","description":"The unified repository for few-shot font generation methods. This repository includes FUNIT (ICCV'19), DM-Font (ECCV'20), LF-Font (AAAI'21) and MX-Font (ICCV'21).","archived":false,"fork":false,"pushed_at":"2023-11-21T04:02:23.000Z","size":22269,"stargazers_count":225,"open_issues_count":9,"forks_count":40,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-02T10:45:34.212Z","etag":null,"topics":["deep-learning","fewshot-font-generation","font","font-generation","generative-models","machine-learning","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clovaai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-05T05:25:39.000Z","updated_at":"2025-03-25T01:28:51.000Z","dependencies_parsed_at":"2023-11-21T04:42:26.618Z","dependency_job_id":null,"html_url":"https://github.com/clovaai/fewshot-font-generation","commit_stats":{"total_commits":8,"total_committers":4,"mean_commits":2.0,"dds":0.5,"last_synced_commit":"9d2b6ace3e23199e2a896de329d4c16489b09a96"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovaai%2Ffewshot-font-generation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovaai%2Ffewshot-font-generation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovaai%2Ffewshot-font-generation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clovaai%2Ffewshot-font-generation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clovaai","download_url":"https://codeload.github.com/clovaai/fewshot-font-generation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054193,"owners_count":21039952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","fewshot-font-generation","font","font-generation","generative-models","machine-learning","pytorch"],"created_at":"2024-11-12T00:22:35.506Z","updated_at":"2025-04-09T14:15:09.327Z","avatar_url":"https://github.com/clovaai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FFG-benchmarks\n\nThis repository provides an unified frameworks to train and test the state-of-the-art few-shot font generation (FFG) models.\n\n## What is Few-shot Font Generation (FFG)?\n\nFew-shot font generation tasks aim to generate a new font library using only a few reference glyphs, e.g., less than 10 glyph images, without additional model fine-tuning at the test time [[ref]](https://arxiv.org/abs/2104.00887).\n\nIn this repository, we do not consider methods fine-tuning on the unseen style fonts.\n\n## Sub-documents\n\n```\ndocs\n├── Dataset.md\n├── FTransGAN-Dataset.md\n├── Inference.md\n├── Evaluator.md\n└── models\n    ├── DM-Font.md\n    ├── FUNIT.md\n    ├── LF-Font.md\n    └── MX-Font.md\n```\n\n## Available models\n\n- FUNIT (Liu, Ming-Yu, et al. ICCV 2019) [[pdf]](https://openaccess.thecvf.com/content_ICCV_2019/papers/Liu_Few-Shot_Unsupervised_Image-to-Image_Translation_ICCV_2019_paper.pdf) [[github]](https://github.com/NVlabs/FUNIT): not originally proposed for FFG tasks, but we modify the unpaired i2i framework to the paired i2i framework for FFG tasks.\n- DM-Font (Cha, Junbum, et al. ECCV 2020) [[pdf]](https://www.ecva.net/papers/eccv_2020/papers_ECCV/papers/123640715.pdf) [[github]](https://github.com/clovaai/dmfont): proposed for complete compositional scripts (e.g., Korean). If you want to test DM-Font in Chinese generation tasks, you have to modify the code (or use other models).\n- LF-Font (Park, Song, et al. AAAI 2021) [[pdf]](https://www.aaai.org/AAAI21Papers/AAAI-1379.ParkS.pdf) [[github]](https://github.com/clovaai/lffont/): originally proposed to solve the drawback of DM-Font, but it still require component labels for generation. Our implementation allows to generate characters with unseen component.\n- MX-Font (Park, Song, et al. ICCV 2021) [[pdf]](https://arxiv.org/abs/2104.00887) [[github]](https://github.com/clovaai/mxfont): generating fonts by employing multiple experts where each expert focuses on different local concepts.\n\n### Not available here, but you may also consider\n\n- EMD (Zhang, Yexun, et al. CVPR 2018) [[pdf]](https://openaccess.thecvf.com/content_cvpr_2018/papers/Zhang_Separating_Style_and_CVPR_2018_paper.pdf) [[github]](https://github.com/zhyxun/Separating-Style-and-Content-for-Generalized-Style-Transfer)\n- AGIS-Net (Yue, Gao, et al. SIGGRAPH Asia 2019) [[pdf]](https://arxiv.org/abs/1910.04987) [[github]](https://github.com/hologerry/AGIS-Net)\n- FTransGAN (Li, Chenhao, et al. WACV 2021) [[pdf]](https://openaccess.thecvf.com/content/WACV2021/papers/Li_Few-Shot_Font_Style_Transfer_Between_Different_Languages_WACV_2021_paper.pdf) [[github]](https://github.com/ligoudaner377/font_translator_gan)\n\n### Model overview\n\n| Model                       | Provided in this repo? | Chinese generation? | Need component labels? |\n|-----------------------------|------------------------|---------------------|------------------------|\n| EMD (CVPR'18)               | X                      | O                   | X                      |\n| FUNIT (ICCV'19)             | O                      | O                   | X                      |\n| AGIS-Net (SIGGRAPH Asia'19) | X                      | O                   | X                      |\n| DM-Font (ECCV'20)           | O                      | X                   | O                      |\n| LF-Font (AAAI'21)           | O                      | O                   | O                      |\n| FTransGAN (WACV'21)         | X                      | O                   | X                      |\n| MX-Font (ICCV'21)           | O                      | O                   | Only for training      |\n\n## Preparing Environments\n\n### Requirements\n\nOur code is tested on `Python \u003e= 3.6` (we recommend [conda](https://docs.anaconda.com/anaconda/install/linux/)) with the following libraries\n\n```\ntorch \u003e= 1.5\nsconf\nnumpy\nscipy\nscikit-image\ntqdm\njsonlib-python3\nfonttools\n```\n\n### Datasets\n\nKorean / Chinese / ...\n\n\nThe full description is in [docs/Dataset.md](docs/Dataset.md)\n\nWe allow two formats for datasets:\n\n- TTF: We allow using the native true-type font (TTF) formats for datasets. It is storage-efficient and easy-to-use, particularly if you want to build your own dataset.\n- Images: We also allow rendered images for datasets, similar to [ImageFoler](https://pytorch.org/vision/stable/datasets.html#torchvision.datasets.ImageFolder) (but a modified version). It is convenient when you want to generate a full font library from the un-digitalized characters (e.g., handwritings).\n\nYou can collect your own fonts from the following web sites (for non-commercial purpose):\n\n- [https://www.foundertype.com/index.php/FindFont/index](https://www.foundertype.com/index.php/FindFont/index) (acknowledgement: [DG-Font](https://github.com/ecnuycxie/DG-Font) refers this web site)\n- [https://chinesefontdesign.com/](https://chinesefontdesign.com/)\n- Any other web sites providing non-commercial fonts\n\nNote that fonts are protected intellectual property and it is unable to release the collected font datasets unless license is cleaned-up. Many font generation papers do not publicly release their own datasets due to this license issue. We also face the same issue here. Therefore, we encourage the users to collect their own datasets from the web, or using the publicly avaiable datasets.\n\nFTransGAN (Li, Chenhao, et al. WACV 2021) [[pdf]](https://openaccess.thecvf.com/content/WACV2021/papers/Li_Few-Shot_Font_Style_Transfer_Between_Different_Languages_WACV_2021_paper.pdf) [[github]](https://github.com/ligoudaner377/font_translator_gan) released the rendered image files for training and evaluating FFG models. We also make our repository able to use the font dataset provided by FTransGAN. More details can be found in [docs/FTransGAN-Dataset.md](docs/FTransGAN-Dataset.md).\n\n## Training\n\nWe separately provide model documents in [docs/models](docs/models) as follows\n\n- [docs/models/FUNIT.md](docs/models/FUNIT.md)\n- [docs/models/DM-Font.md](docs/models/DM-Font.md)\n- [docs/models/LF-Font.md](docs/models/LF-Font.md)\n- [docs/models/MX-Font.md](docs/models/MX-Font.md)\n\n\n## Generation\n\n### Preparing reference images\n\nDetailed instruction for preparing reference images is decribed in [here](docs/Reference.md).\n    \n### Run test\n\nPlease refer following documents to train the model:\n\n* DM-Font: [docs/models/DM-Font.md](docs/models/DM-Font.md)\n* LF-Font(Phase 1, 2): [docs/models/LF-Font.md](docs/models/LF-Font.md)\n* MX-Font: [docs/models/MX-Font.md](docs/models/MX-Font.md)\n* FUNIT(modified for fonts): [docs/models/FUNIT.md](docs/models/FUNIT.md)\n\n\n## Evaluation\n\nDetailed instructions for preparing evaluator and testing the generated images are decribed in [here](docs/Evaluation.md).\n\n## License\n\nThis project is distributed under [MIT license](LICENSE), except [FUNIT](FUNIT) and [base/modules/modules.py](base/modules/modules.py) which is adopted from https://github.com/NVlabs/FUNIT.\n\n```\nFFG-benchmarks\nCopyright (c) 2021-present NAVER Corp.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclovaai%2Ffewshot-font-generation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclovaai%2Ffewshot-font-generation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclovaai%2Ffewshot-font-generation/lists"}