Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

edumagiceco/OCR-PoC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

OCR-PoC

VLM(Vision-Language Model) 기반 고정밀 문서 OCR 서비스 PoC

개요

Chandra OCR (Qwen3-VL 기반)을 활용한 문서 인식 서비스입니다. Docker Compose 기반 MSA 아키텍처로 구성되어 있습니다.

기술 스택

구성요소 기술
OCR 엔진 Chandra OCR (Qwen3-VL, 17GB)
Backend FastAPI + Uvicorn
Frontend Streamlit
Container NVIDIA NGC PyTorch (25.05-py3)
GPU NVIDIA Blackwell (GB10) 지원

주요 기능

  • 40+ 언어 지원
  • PDF, 이미지 파일 OCR (PNG, JPG, TIFF, BMP, WebP)
  • 표/수식 인식
  • 손글씨 인식
  • 레이아웃 보존
  • Markdown, HTML, JSON 출력 형식

시스템 요구사항

  • Docker & Docker Compose
  • NVIDIA GPU (CUDA 12.x 이상)
  • GPU 메모리: 최소 20GB 권장
  • 디스크: HuggingFace 모델 캐시용 20GB 이상

설치 및 실행

1. 저장소 클론

git clone https://github.com/edumagiceco/OCR-PoC.git
cd OCR-PoC

2. Docker 이미지 빌드 및 실행

docker compose up -d --build

첫 빌드 시 NVIDIA NGC 이미지 다운로드로 약 10-15분 소요

3. 서비스 접속

서비스 URL
Frontend (Streamlit) http://localhost:8501
Backend API http://localhost:8001

API 엔드포인트

Health Check

curl http://localhost:8001/health

OCR 처리

# 파일 업로드
curl -X POST "http://localhost:8001/api/ocr/upload" \
 -F "file=@document.pdf" \
 -F "output_format=markdown"
# 결과 조회
curl "http://localhost:8001/api/ocr/status/{task_id}"

지원 형식 조회

curl http://localhost:8001/api/ocr/formats

프로젝트 구조

OCR-PoC/
├── docker-compose.yml # Docker Compose 설정
├── services/
│ ├── frontend/ # Streamlit 프론트엔드
│ │ ├── Dockerfile
│ │ ├── app.py
│ │ └── requirements.txt
│ └── ocr-backend/ # FastAPI 백엔드
│ ├── Dockerfile
│ ├── app/
│ │ ├── __init__.py
│ │ └── main.py
│ └── requirements.txt
└── shared/ # 공유 디렉토리

환경 변수

Backend (ocr-backend)

변수 설명 기본값
TORCH_DEVICE GPU 디바이스 지정 cuda:0
HF_HOME HuggingFace 캐시 경로 /app/.cache/huggingface
CUDA_VISIBLE_DEVICES 사용할 GPU 0

성능

항목
모델 로딩 (첫 요청) ~2-3분
추론 시간 (이후 요청) ~10-15초
GPU 메모리 사용 ~16.4GB

주의사항

  • 첫 번째 OCR 요청 시 모델 로딩으로 인해 2-3분 소요됩니다
  • 모델은 메모리에 캐시되어 이후 요청은 빠르게 처리됩니다
  • NVIDIA Blackwell GPU 사용 시 TORCH_DEVICE=cuda:0 설정 필요

라이선스

Private Repository

About

VLM 기반 OCR PoC - Chandra OCR (Qwen3-VL) + FastAPI + Streamlit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /