{"id":31211525,"url":"https://github.com/cyberagentailab/tdc-typography-generation","last_synced_at":"2025-09-21T05:30:38.556Z","repository":{"id":215377482,"uuid":"727119796","full_name":"CyberAgentAILab/tdc-typography-generation","owner":"CyberAgentAILab","description":"This repository contains codes for https://arxiv.org/abs/2309.02099","archived":false,"fork":false,"pushed_at":"2024-10-20T16:47:00.000Z","size":17334,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-10T07:42:50.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyberAgentAILab.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-04T08:18:33.000Z","updated_at":"2025-03-31T07:42:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"239775c7-9ba6-4dcb-8385-67ceb3c98d5d","html_url":"https://github.com/CyberAgentAILab/tdc-typography-generation","commit_stats":null,"previous_names":["cyberagentailab/tdc-typography-generation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CyberAgentAILab/tdc-typography-generation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberAgentAILab%2Ftdc-typography-generation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberAgentAILab%2Ftdc-typography-generation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberAgentAILab%2Ftdc-typography-generation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberAgentAILab%2Ftdc-typography-generation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyberAgentAILab","download_url":"https://codeload.github.com/CyberAgentAILab/tdc-typography-generation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberAgentAILab%2Ftdc-typography-generation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276195627,"owners_count":25601152,"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","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-09-21T05:30:37.056Z","updated_at":"2025-09-21T05:30:38.553Z","avatar_url":"https://github.com/CyberAgentAILab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Paper: Towards Diverse and Consistent Typography Generation\nWataru Shimoda\u003csup\u003e1\u003c/sup\u003e, Daichi Haraguchi\u003csup\u003e2\u003c/sup\u003e, Seiichi Uchida\u003csup\u003e2\u003c/sup\u003e, Kota Yamaguchi\u003csup\u003e1\u003c/sup\u003e  \n\u003csup\u003e1\u003c/sup\u003eCyberAgent.Inc, \u003csup\u003e2\u003c/sup\u003e Kyushu University  \nAccepted to WACV2024.\n[[Publication](https://openaccess.thecvf.com/content/WACV2024/papers/Shimoda_Towards_Diverse_and_Consistent_Typography_Generation_WACV_2024_paper.pdf)]\n[[Arxiv](https://arxiv.org/abs/2309.02099)]\n[[Project-page](https://cyberagentailab.github.io/tdc-typography-generation/)]\n\n## Introduction\nThis repository contains the codes for [\"Towards Diverse and Consistent Typography Generation\"](https://arxiv.org/abs/2309.02099).\n\n\u003cimg src = \"images/teaser.jpg\" title = \"teaser\" \u003e\n\n## Requirements\nWe check the reproducibility under the environment.\n- Ubuntu (\u003e=20.04)\n- Python3 (\u003e=3.8, \u003c3.11)\n\n\n## Install\nClone this repository and navigate to the folder\n\n``` sh\ngit clone https://github.com/CyberAgentAILab/tdc-typography-generation.git\ncd tdc-typography-generation\n```\n\nWe manage the dependencies of python libraries by [pyproject.toml](https://github.com/CyberAgentAILab/tdc-typography-generation/blob/main/pyproject.toml).  \nPlease install the dependencies via pip or poetry using [pyproject.toml](https://github.com/CyberAgentAILab/tdc-typography-generation/blob/main/pyproject.toml). \n\n\nIf the version of setuptools is `setuptools \u003e=61.0.0`, the following command installs the dependencies via pip:\n``` sh\npip install .\n```\nor  \nWe recommend installing the dependencies using Poetry (see [official docs](https://python-poetry.org/docs/)):\n``` sh\npoetry install\n```\nNote that we omit the head of commands `poetry run` in the after guidance for simplification.\n\n## Dataset\nOur model is trained and tested on [Crello dataset](https://huggingface.co/datasets/cyberagent/crello), and this dataset is open on [Hugging Face](https://huggingface.co/).  \nWe can download this dataset through the [Hugging Face Dataset API](https://huggingface.co/docs/datasets/index), but this dataset does not contain high-resolution background images. \n\nWe provide background images via Google Drive ([link](https://storage.googleapis.com/ailab-public/tdc_typography_generation/generate_bg_png.tar.gz), 3.6GB).  \nPlease download the background images and locate them to `data/generate_bg_png/`.  \n``` sh\ntar zxvf generate_bg_png.tar.gz \nmv generate_bg_png data/\nrm generate_bg_png.tar.gz\n```\n\nWe also provide font files for rendering designs and computing appropriate text sizes via Google Drive ([link](https://storage.googleapis.com/ailab-public/tdc_typography_generation/font.tar.gz), 43MB).  \nPlease download the font files and locate them to `data/font/`.  \n``` sh\ntar zxvf font.tar.gz \nmv font data/\nrm font.tar.gz\n```\n\n## Usage\nWe prepare scripts for experiments as the following.\n\n### Preprocessing\nWe recommend adding features to the dataset in advance, it makes training and testing faster.  \nWe provide a script for preprocessing:\n``` sh\npython -m typography_generation map_features --datadir data\n```\nThis script extends the dataset via [map function](https://huggingface.co/docs/datasets/v2.15.0/en/package_reference/main_classes#datasets.Dataset.map).  \nThe extended dataset is saved in `data/map_featreus`, and `--use_extended_dataset` option manages the use of the extended dataset.\n\n### Training\nThe following command trains a model, it takes a half day with the preprocessed dataset and a NVIDIA T4 machine.  \nWe handle the detail of training via configuration files in `data/config/*.yaml`.  \nThe basic configurations are in `src/typography_generation/config/*.py`.  \n\n``` sh\npython -m typography_generation train_evaluation \\\n          --configname bart \\\n          --jobdir ${OUTPUT_DIR} \\\n          --datadir data \\\n          --use_extended_dataset \\\n          --gpu \\\n```\nThe outputs are in `${OUTPUT_DIR}`.\n\n### Sampling \nThe following command samples typographic attributes.  \nThis command requires `--weight` option, which is a path for loading weights of a trained model.  \nA weight file obtained by the avobe training command is in  `${OUTPUT_DIR}/weight.pth`.  \nPlease assign a path of a weight file to `${WEIGHT_FILE}`.  \nA pretrained-model reproduced by this repository is [here](https://storage.googleapis.com/ailab-public/tdc_typography_generation/model.pth).  \n``` sh\npython -m typography_generation structure_preserved_sample \\\n          --configname bart \\\n          --jobdir ${OUTPUT_DIR} \\\n          --datadir data \\\n          --weight=${WEIGHT_FILE} \\\n          --use_extended_dataset \\\n          --gpu \\\n```\n\n\n## Visualization\nWe provides notebooks for showing results.  \n- `notebooks/score.ipnyb` shows scores of the saved results in `${OUTPUT_DIR}`.  \n- `notebooks/vis.ipnyb` shows generated graphic designs in `${OUTPUT_DIR}`.  \n\n## Reference\n```bibtex\n@misc{shimoda_2024_tdctg,\n    author    = {Shimoda, Wataru and Haraguchi, Daichi and Uchida, Seiichi and Yamaguchi, Kota},\n    title     = {Towards Diverse and Consistent Typography Generation},\n    publisher = {Winter Conference on Applications of Computer Vision (WACV)},\n    year      = {2024},\n}\n```\n\n## Contact\nThis repository is maintained by Wataru shimoda(wataru_shimoda[at]cyberagent.co.jp).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberagentailab%2Ftdc-typography-generation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberagentailab%2Ftdc-typography-generation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberagentailab%2Ftdc-typography-generation/lists"}