Coder Social home page Coder Social logo

kwonkangbin / 19-12-font Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 2sooy/19-12-font

0.0 0.0 0.0 64.54 MB

2019년 캡스톤 디자인 - 사용자 필적 맞춤형 폰트 생성 서비스

JavaScript 40.32% Python 52.48% CSS 4.36% HTML 2.84%

19-12-font's Introduction

19-12-FONT

2019년 캡스톤 디자인 - 사용자 필적 맞춤형 폰트 생성 서비스

개요

한글 폰트 제작의 어려움을 덜기 위해, 사용자가 작성한 글자 디자인의 특성을 GAN이라는 딥러닝 기술을 이용하여 학습한 후, 나머지 한글 글자 이미지들을 자동 생성하여 자신만의 손글씨 폰트를 만들어 제공합니다.

실행 영상

개발 환경

Ubuntu 16.04
Nvidia GTX 1060
CUDA 10.0
CUDNN 7.4.1
tensorflow 1.14.0
python 2.7.x

동작

# 패키지 설치
npm install
# 한글 폰트 사용을 위한 처리 작업
cp public/javascripts/os2.js node_modules/svg2ttf/lib/ttf/tables/.
# 학습된 모델 다운 & 압축해제 & 덮어쓰기
.
├── font_python
│   ├── baseline
│   │   └── checkpoint
│   │       └── experiment_0_batch_16
│   │           ├── checkpoint
│   │           ├── unet.model-107850.data-00000-of-00001
│   │           ├── unet.model-107850.index
│   │           └── unet.model-107850.meta
 

Download PreTrained Model

# 실행하기
node app.js
# 템플릿 다운 및 손글씨 작성
.
├── template
│   ├── 1-unifrom.png
│   ├── 2-uniform.png
│   └── 3-uniform.png

작성된 템플릿 예시

세부 동작

글자 영역 추출

# crop
python 01_crop.py --src_dir=[템플릿 폴더 경로] --dst_dir=cropped_dir --txt=399-uniform.txt

paired data 생성

# font2image
python 02_font2image.py --src_font=NanumGothic.ttf --dst_font=NanumGothic.ttf --sample_dir=pair_dir/ --handwriting_dir=cropped_dir/

object data 생성

# package
python 03_package.py --dir=pair_dir/ --save_dir=package_dir

손글씨 학습 - 1

# train - 01
python2 04_train.py --experiment_dir=experiment/ --experiment_id=0 --batch_size=16 --lr=0.001 --epoch=60 --sample_steps=100 --schedule=20 --L1_penalty=100 --Lconst_penalty=15 --freeze_encoder=1

손글씨 학습 - 2

# train - 02
python2 04_train.py --experiment_dir=experiment/ --experiment_id=0 --batch_size=16 --lr=0.001 --epoch=120 --sample_steps=100 --schedule=40 --L1_penalty=500 --Lconst_penalty=1000 --freeze_encoder=1

학습한 모델을 통해 나머지 손글씨 이미지 추출

# infer
python2 05_infer.py --model_dir=experiment/checkpoint/experiment_0_batch_16 --batch_size=1 --source_obj=experiment/data/val.obj --embedding_ids=0 --save_dir=experiment/inferred_result --progress_file=experiment/logs/progress

생성된 이미지 폴더 옮기기

.
├── FONT
│   ├── inferred_result

폰트 파일로 변환

# generateTTF.js
node generateTTF.js

폰트 적용

참고

https://github.com/kaonashi-tyc/zi2zi
https://github.com/periannath/neural-fonts
https://github.com/yjjng11/Neural-fonts-webapp

19-12-font's People

Contributors

2sooy avatar yezinmong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.