[SIGGRAPH 2020] Attribute2Font: Creating Fonts You Want From Attributes

Overview

Attr2Font

Introduction

This is the official PyTorch implementation of the Attribute2Font: Creating Fonts You Want From Attributes.

Teaser

Paper: arXiv | Research Gate
Supplementary Material: link
Video: link
Code: GitHub

Abstract

Font design is now still considered as an exclusive privilege of professional designers, whose creativity is not possessed by existing software systems. Nevertheless, we also notice that most commercial font products are in fact manually designed by following specific requirements on some attributes of glyphs, such as italic, serif, cursive, width, angularity, etc. Inspired by this fact, we propose a novel model, Attribute2Font, to automatically create fonts by synthesizing visually pleasing glyph images according to user-specified attributes and their corresponding values. To the best of our knowledge, our model is the first one in the literature which is capable of generating glyph images in new font styles, instead of retrieving existing fonts, according to given values of specified font attributes. Specifically, Attribute2Font is trained to perform font style transfer between any two fonts conditioned on their attribute values. After training, our model can generate glyph images in accordance with an arbitrary set of font attribute values. Furthermore, a novel unit named Attribute Attention Module is designed to make those generated glyph images better embody the prominent font attributes. Considering that the annotations of font attribute values are extremely expensive to obtain, a semi-supervised learning scheme is also introduced to exploit a large number of unlabeled fonts. Experimental results demonstrate that our model achieves impressive performance on many tasks, such as creating glyph images in new font styles, editing existing fonts, interpolation among different fonts, etc.

Model Architecture

Architecture

Demonstration

Demo

Prerequisites

  • Linux
  • CPU or NVIDIA GPU + CUDA cuDNN
  • Python 3
  • PyTorch 1.0+

Get Started

Installation

  1. Install PyTorch, torchvison and dependencies from https://pytorch.org
  2. Clone this repo:
    git clone https://github.com/hologerry/Attr2Font
    cd Attr2Font
  3. Download the official pre-trained vgg19 model: vgg19-dcbb9e9d.pth, and put it under this project root folder

Datasets

Download the dataset from PKU Disk, Google Drive or MEGA and put it into the data/:

data/
    explor_all/
        image/
        attributes.txt/

| This dataset is constructed by O’Donovan et al. Exploratory Font Selection Using Crowdsourced Attributes. TOG 2014

Model Training

python main.py --phase train

Model Testing

python main.py --phase test

Model Interpolation

python main.py --phase test_interp --test_epoch EPOCH

Citation:

If you use this code or find our work is helpful, please consider citing our work:

@article{WangSIGGRAPH2020,
  author = {Yizhi Wang*, Yue Gao*, Zhouhui Lian},
  title = {Attribute2Font: Creating Fonts You Want From Attributes},
  journal = {ACM Trans. Graph.},
  year = {2020}
}

| * Denotes equal contribution

Copyright

The code and dataset are only allowed for PERSONAL and ACADEMIC usage.

Comments
  • Model Interpolation Error

    Model Interpolation Error

    I have done Model Training and Model Testing. When I start to do Model Interpolation, the error occurs as follows:

    $ python main.py --phase test_interp --test_epoch EPOCH
    usage: main.py [-h] [--init_epoch INIT_EPOCH] [--n_epochs N_EPOCHS]
                   [--decay_epoch DECAY_EPOCH] [--multi_gpu MULTI_GPU]
                   [--data_root DATA_ROOT] [--dataset_name {explor_all}]
                   [--img_size IMG_SIZE] [--batch_size BATCH_SIZE]
                   [--n_threads N_THREADS] [--n_style N_STYLE] [--channel CHANNEL]
                   [--attr_channel ATTR_CHANNEL] [--attr_embed ATTR_EMBED]
                   [--style_out_channel STYLE_OUT_CHANNEL]
                   [--n_res_blocks N_RES_BLOCKS] [--attention ATTENTION]
                   [--dis_pred DIS_PRED] [--lr LR] [--b1 B1] [--b2 B2]
                   [--experiment_name EXPERIMENT_NAME] [--check_freq CHECK_FREQ]
                   [--sample_freq SAMPLE_FREQ] [--log_freq LOG_FREQ]
                   [--phase {train,test,test_interp}] [--test_epoch TEST_EPOCH]
                   [--interp_cnt INTERP_CNT] [--lambda_l1 LAMBDA_L1]
                   [--lambda_char LAMBDA_CHAR] [--lambda_GAN LAMBDA_GAN]
                   [--lambda_cx LAMBDA_CX] [--lambda_attr LAMBDA_ATTR]
    main.py: error: argument --test_epoch: invalid int value: 'EPOCH'
    
    opened by WangDongDesign 5
  • train error

    train error

    2020-11-05 15-38-57屏幕截图 when input image size is 64 in style encoder,it will be transformed to a tensor which size is (1, 165, 1 ,1) and it will be fed into residual black , which has a conv(kernel = 3) and generate an error.

    opened by FBEMPSS 3
  • StyleEncoder ignores the attention parameter

    StyleEncoder ignores the attention parameter

    The StyleEncoder class takes in a boolean attention param, defaulting to true, but this param is ignored and no attention is ever used: https://github.com/hologerry/Attr2Font/blob/master/model.py#L173

    opened by chanind 1
  • hello! Are the attrfont CN and attrfont ENG datasets provided?

    hello! Are the attrfont CN and attrfont ENG datasets provided?

    Hello. I am very interested in your experiment, and I have trained in the data set provided, and the effect is very good, so I want to further train in the Chinese data set. Is it convenient for attrfont CN and attrfont eng data set over there?

    opened by zj916716524 1
  • dataset download

    dataset download

    There is some issue with the downloading of the dataset. The downloading is too slow and stops after some time. I think there is some issue on the server side.

    opened by cheng043 1
  • RuntimeError: CUDA error: an illegal memory access was encountered

    RuntimeError: CUDA error: an illegal memory access was encountered

    Hi, I can not run "Sampling " part code . https://github.com/hologerry/Attr2Font/blob/810404b16c7d77ed012bb4b86cdddc2a9e0ddc36/main.py#L242-L248

    it occur in this part code . And I confused L242 and L243 are the both set variable val_attr_A_intensity but with different value, why ?

    opened by Johnson-yue 1
  • Random result glyphs from generator

    Random result glyphs from generator

    Hi! Found that the generator always produces random glyphs with the same attribute parameters passed (intensity). The font as source for generation is always the same. Is this normal behavior? Can the generation be constant with constant input values ​​to the generator?

    opened by halvomez 1
  • about arguments of Test options

    about arguments of Test options

    @hologerry

    Could you explain each options meaning? (--channel, --attr_channel, --attr_embed, etc) Actually, I want to know how to input attributes value to model. If I want to make font which is similar with Serif font, how can I do ?

    Thanks : )

    opened by an2416 0
  • What is the char class for?

    What is the char class for?

    It looks like the generator model includes a character classifier output, which classifies the character to one of 52 one-hot values. The number 52 is hardcoded: https://github.com/hologerry/Attr2Font/blob/master/model.py#L231. What is this for? The discriminator takes in a character class param, but then ignores it and never references it https://github.com/hologerry/Attr2Font/blob/master/model.py#L367. Is the char class being in this algorithm a mistake, or is it necessary for the font generation to function? If so, why?

    opened by chanind 4
Owner
Yue Gao
Researcher at Microsoft Research Asia
Yue Gao
Converts geometry node attributes to built-in attributes

Attribute Converter Simplifies converting attributes created by geometry nodes to built-in attributes like UVs or vertex colors, as a single click ope

Ivan Notaros 12 Dec 22, 2022
Face Identity Disentanglement via Latent Space Mapping [SIGGRAPH ASIA 2020]

Face Identity Disentanglement via Latent Space Mapping Description Official Implementation of the paper Face Identity Disentanglement via Latent Space

null 150 Dec 7, 2022
A code repository associated with the paper A Benchmark for Rough Sketch Cleanup by Chuan Yan, David Vanderhaeghe, and Yotam Gingold from SIGGRAPH Asia 2020.

A Benchmark for Rough Sketch Cleanup This is the code repository associated with the paper A Benchmark for Rough Sketch Cleanup by Chuan Yan, David Va

null 33 Dec 18, 2022
Implementation for "Manga Filling Style Conversion with Screentone Variational Autoencoder" (SIGGRAPH ASIA 2020 issue)

Manga Filling with ScreenVAE SIGGRAPH ASIA 2020 | Project Website | BibTex This repository is for ScreenVAE introduced in the following paper "Manga F

null 30 Dec 24, 2022
TilinGNN: Learning to Tile with Self-Supervised Graph Neural Network (SIGGRAPH 2020)

TilinGNN: Learning to Tile with Self-Supervised Graph Neural Network (SIGGRAPH 2020) About The goal of our research problem is illustrated below: give

null 59 Dec 9, 2022
Fader Networks: Manipulating Images by Sliding Attributes - NIPS 2017

FaderNetworks PyTorch implementation of Fader Networks (NIPS 2017). Fader Networks can generate different realistic versions of images by modifying at

Facebook Research 753 Dec 23, 2022
SAN for Product Attributes Prediction

SAN Heterogeneous Star Graph Attention Network for Product Attributes Prediction This repository contains the official PyTorch implementation for ADVI

Xuejiao Zhao 9 Dec 12, 2022
Pcos-prediction - Predicts the likelihood of Polycystic Ovary Syndrome based on patient attributes and symptoms

PCOS Prediction ?? Predicts the likelihood of Polycystic Ovary Syndrome based on

Samantha Van Seters 1 Jan 10, 2022
A very simple tool to rewrite parameters such as attributes and constants for OPs in ONNX models. Simple Attribute and Constant Modifier for ONNX.

sam4onnx A very simple tool to rewrite parameters such as attributes and constants for OPs in ONNX models. Simple Attribute and Constant Modifier for

Katsuya Hyodo 6 May 15, 2022
Compute execution plan: A DAG representation of work that you want to get done. Individual nodes of the DAG could be simple python or shell tasks or complex deeply nested parallel branches or embedded DAGs themselves.

Hello from magnus Magnus provides four capabilities for data teams: Compute execution plan: A DAG representation of work that you want to get done. In

null 12 Feb 8, 2022
A very simple tool for situations where optimization with onnx-simplifier would exceed the Protocol Buffers upper file size limit of 2GB, or simply to separate onnx files to any size you want.

sne4onnx A very simple tool for situations where optimization with onnx-simplifier would exceed the Protocol Buffers upper file size limit of 2GB, or

Katsuya Hyodo 10 Aug 30, 2022
Everything you want about DP-Based Federated Learning, including Papers and Code. (Mechanism: Laplace or Gaussian, Dataset: femnist, shakespeare, mnist, cifar-10 and fashion-mnist. )

Differential Privacy (DP) Based Federated Learning (FL) Everything about DP-based FL you need is here. (所有你需要的DP-based FL的信息都在这里) Code Tip: the code o

wenzhu 83 Dec 24, 2022
General Virtual Sketching Framework for Vector Line Art (SIGGRAPH 2021)

General Virtual Sketching Framework for Vector Line Art - SIGGRAPH 2021 Paper | Project Page Outline Dependencies Testing with Trained Weights Trainin

Haoran MO 118 Dec 27, 2022
Implementation for "Seamless Manga Inpainting with Semantics Awareness" (SIGGRAPH 2021 issue)

Seamless Manga Inpainting with Semantics Awareness [SIGGRAPH 2021](To appear) | Project Website | BibTex Introduction: Manga inpainting fills up the d

null 101 Jan 1, 2023
Supplementary code for SIGGRAPH 2021 paper: Discovering Diverse Athletic Jumping Strategies

SIGGRAPH 2021: Discovering Diverse Athletic Jumping Strategies project page paper demo video Prerequisites Important Notes We suspect there are bugs i

null 54 Dec 6, 2022
Official implementation of "StyleCariGAN: Caricature Generation via StyleGAN Feature Map Modulation" (SIGGRAPH 2021)

StyleCariGAN in PyTorch Official implementation of StyleCariGAN:Caricature Generation via StyleGAN Feature Map Modulation in PyTorch Requirements PyTo

PeterZhouSZ 49 Oct 31, 2022
Code for HodgeNet: Learning Spectral Geometry on Triangle Meshes, in SIGGRAPH 2021.

HodgeNet | Webpage | Paper | Video HodgeNet: Learning Spectral Geometry on Triangle Meshes Dmitriy Smirnov, Justin Solomon SIGGRAPH 2021 Set-up To ins

Dima Smirnov 61 Nov 27, 2022
Tracing Versus Freehand for Evaluating Computer-Generated Drawings (SIGGRAPH 2021)

Tracing Versus Freehand for Evaluating Computer-Generated Drawings (SIGGRAPH 2021) Zeyu Wang, Sherry Qiu, Nicole Feng, Holly Rushmeier, Leonard McMill

Zach Zeyu Wang 23 Dec 9, 2022
PyTorch implementations for our SIGGRAPH 2021 paper: Editable Free-viewpoint Video Using a Layered Neural Representation.

st-nerf We provide PyTorch implementations for our paper: Editable Free-viewpoint Video Using a Layered Neural Representation SIGGRAPH 2021 Jiakai Zha

Diplodocus 258 Jan 2, 2023