How ppisljar/pdf_translator works
Project type and purpose
• This is a full-stack “PDF Translator” application with both a Web UI and a CLI.
• It accepts PDF files, runs layout analysis + OCR + translation, then renders a translated PDF preserving the original layout.
• Translation engines supported: Google Translate (default) and OpenAI GPT.
• Layout engines: UniLM DiT (and planned VGT). OCR engine: PaddleOCR.
File structure
• Top-level entries:
• Dockerfile, Makefile, config.yaml, requirements.txt – build, config, dependencies, deployment
• server.py – backend HTTP server / API entry point
• cli.py – command-line interface entry point
• assets/ – static files (HTML/CSS/JS) for Web UI
• models/ – pre-trained model binaries and YAML configs for DiT, VGT, PaddleOCR
• modules/ – pluggable implementation of engines:
– modules/layout (e.g. ditod.py)
– modules/ocr (paddle.py)
– modules/translate (openai_gpt.py)
– modules/font (simple.py)
• utils/ – lower-level helpers for GUI, model loading, inference pipelines, dataset mapping, evaluation, etc.
README for additional insights
• Describes feature set, install steps, Docker and venv workflows.
• Emphasizes GPU dependency, Dockerbased deployment, port 8765 for GUI.
• Mentions future goals (VGT support, font detection, etc.).