typeAI / README.md
NeerajNotfound's picture
Upload 88 files
e47c691 verified

A newer version of the Streamlit SDK is available: 1.53.1

Upgrade
metadata
title: Type AI
emoji: ✒️
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.25.0
python_version: '3.10'
app_file: app.py
pinned: false

Type.ai - AI Handwriting to Font Generator

Convert your handwriting into a custom TrueType font file using AI-powered character detection.

Features

  • AI Character Detection: Uses advanced contour analysis and OCR to extract characters
  • Style Analysis: Captures stroke width, slant, and roughness of your handwriting
  • Vector Conversion: Converts bitmap characters to smooth vector paths
  • Font Generation: Creates installable TTF font files
  • Web UI: Modern drag-and-drop interface
  • REST API: Integrate into your own applications

Quick Start

1. Install Dependencies

cd Type.ai
pip install -r requirements.txt

2. Command Line Usage

# Basic usage
python main.py handwriting.jpg --output MyFont.ttf --name "MyHandwriting"

# With debug output
python main.py sample.png -o CustomFont.ttf -n "Custom Font" --debug

3. Web Interface

# Start the server
python server.py

# Open in browser
# http://localhost:8000/ui/

Tips for Best Results

  1. Write clearly with consistent size
  2. Include all letters A-Z (uppercase and/or lowercase)
  3. Use dark ink on white paper
  4. Good lighting - avoid shadows
  5. High resolution scan or photo

Project Structure

Type.ai/
├── src/
│   ├── preprocessing.py    # Image enhancement
│   ├── segmentation.py     # Character detection
│   ├── style_extractor.py  # Style analysis
│   ├── vectorizer.py       # Bitmap to vector
│   ├── font_generator.py   # TTF creation
│   └── pipeline.py         # Main orchestrator
├── ui/
│   └── index.html          # Web interface
├── main.py                 # CLI
├── server.py               # FastAPI server
└── requirements.txt        # Dependencies

API Endpoints

Endpoint Method Description
/api/upload POST Upload handwriting image
/api/status/{job_id} GET Check processing status
/api/download/{job_id} GET Download generated font
/api/preview/{job_id} GET Get segmentation preview

Requirements

  • Python 3.8+
  • PyTorch 1.9+
  • OpenCV
  • fonttools
  • Tesseract OCR (optional, for character recognition)

License

MIT