Skip to content

qwen3 vl python ocr script mlx.stub

Nicolas Cravino edited this page Apr 11, 2026 · 4 revisions

id: qwen3-vl-python-ocr-script-mlx name: Qwen3 VL OCR Script (MLX) repo_path: /sessions/charming-sleepy-ritchie/repos/QWEN3-VL-Python-OCR-Script-MLX remote_url: https://github.com/sw30labs/QWEN3-VL-Python-OCR-Script-MLX.git primary_language: Python framework: mlx-vlm ingested: 2026-04-11 last_commit_date: 2026-04-11

Qwen3 VL OCR Script (MLX)

Purpose

Batch caption every image in an input directory using a local MLX vision-language model (Qwen3-VL-30B). Auto-downloads model weights. Fully offline OCR and image understanding.

Architecture

Single script (src/run_ocr.py):

  1. Scans input directory for images
  2. Auto-downloads Qwen3-VL-30B weights via huggingface-hub
  3. Loads MLX model
  4. Generates captions per image
  5. Writes individual JSON files + combined captions.json

Output Format

  • Individual JSON files per image with caption metadata
  • Combined captions.json for batch analysis

Key Technologies

  • Vision-Language Model: Qwen3-VL-30B via mlx-vlm
  • Image Processing: OpenCV, Pillow, torchvision
  • MLX Framework: Apple Silicon optimized

Dependencies

mlx, mlx-lm, Pillow, huggingface-hub, mlx-vlm, torch, torchvision, opencv-python, numpy

Tags

python, mlx, apple-silicon, local-inference, ocr

Cross-references

Clone this wiki locally