Files
awesome-python/website/data/category_intros/computer-vision.md
T
Vinta ChenandClaude 88cfcf6f4d docs: rewrite Computer Vision category intro
Covers OpenCV as the default, Ultralytics YOLO for detection/segmentation/pose models and its AGPL-3.0/Enterprise License terms, Kornia for GPU-batch vision ops, FiftyOne for dataset curation, and pytesseract vs EasyOCR for OCR.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-27 00:27:02 +08:00

3.1 KiB

Start with OpenCV when you need a Python computer vision library for images and video. To train and run detection models, use Ultralytics YOLO.

How to choose:

  • Image and video processing: OpenCV
  • Detection, segmentation, and pose models: Ultralytics YOLO
  • Vision ops inside a PyTorch model: Kornia
  • Dataset curation and model evaluation: FiftyOne
  • OCR on clean, printed documents: pytesseract
  • OCR on text in photos: EasyOCR

OpenCV comes as four pip packages that share the cv2 namespace, so install only one: opencv-python for the main modules, or opencv-contrib-python to add the extra modules. If you never call cv2.imshow or you build your GUI with another toolkit, install the headless variant of either one, which also makes Docker images smaller.

Ultralytics YOLO covers the whole life of a model: train, validate, predict, export, and track, from Python or the yolo command. Its docs recommend starting training from a pretrained model. To deploy, export it to ONNX, TensorRT, CoreML, or another format. The code and the models you train with it are AGPL-3.0, so unless you open-source your whole project, you need an Enterprise License.

Kornia is a differentiable computer vision library like OpenCV, with strong GPU support. Every operator works on PyTorch tensors and supports autograd, so vision ops can run on the GPU and sit inside your training loop.

FiftyOne works on the data side of a model. Load your dataset and your model's predictions into it, then see where the model succeeds and fails, and find mistakes in your labels. It integrates with Ultralytics, so you can run and fine-tune YOLO models on FiftyOne datasets.

pytesseract wraps the Tesseract OCR engine, which you install on its own, then put on your PATH or point tesseract_cmd at. Tesseract suits clean, printed text and needs no GPU. To get better results, improve the image first: Tesseract works best at 300 DPI or more, and retraining rarely helps unless you use an unusual font or a new language.

EasyOCR is a general OCR that reads text in photos as well as in documents, in dozens of languages. It handles text in photos, where Tesseract struggles, but it's slow without a GPU. Create a Reader for your languages once and reuse it for every image, since that call loads the model into memory.

Ultralytics YOLO, Kornia, and EasyOCR run on PyTorch. When you need a specific CUDA build, install PyTorch before the library, as Ultralytics and Kornia recommend. EasyOCR's README says the same for Windows.