Skip to main content
  1. Posts/

What is OpenMMLab and how it is used in computer vision

504 words
Table of Contents

OpenMMLab is a comprehensive open-source platform developed to accelerate research and development in computer vision.

OpenMM Lab

OpenMMLab serves as a collection of toolkits and frameworks for a wide range of computer vision (CV) tasks, ie. object detection, semantic segmentation, pose estimation, and optical character recognition (OCR). Built on top of PyTorch, it has become one of the most popular and influential repositories for computer vision, bridging the gap between academic research and industrial applications. Check out the OpenMMLab Github

Core Components of OpenMMLab

MMDetection: A versatile toolbox for object detection and instance segmentation. It supports a wide array of models, including Faster R-CNN, YOLO, and RetinaNet, allowing easy customization and training on custom datasets. MMDetection is a go-to framework for researchers and practitioners working on tasks like autonomous driving, security, and more.

MMSegmentation: Semantic segmentation component by supporting state-of-the-art (SOTA) models and facilitates experiments with various backbones and training strategies. MMSegmentation is useful in quantitative fields like medical imaging where precise pixel-level classification is crucial.

MMPose: A human pose estimation component handles tasks such as full-body keypoint detection and even more specialized tasks like facial landmark detection. MMPose supports multiple backbones and is designed to be modular.

MMOCR: Tailored for optical character recognition(OCR) tasks, which has various models for text detection and recognition.

MMDeploy: A deployment framework that allows models developed using OpenMMLab toolkits to be efficiently deployed across different hardware and software.

OpenMM and Colab

Open Google Colab and start a new notebook.

Run in Colab

OpenMM is community driven, there may be some inconsistencies in their documentation

Recent Google Colab has a built-in torch:Version: 2.3.1+cu121 and CUDA 12.2, it should generally work with the following steps

Start with

  1. !pip3 install -q openmim in its own cell because the kernel may restart after you run, simply re-run it and the following lines should work

  2. Then, run the folowing two lines. mmcv may actually installed with a version not fully compatible with 2.2.0, but its okay, simply address that in the next steps.

    !mim install -q mmengine
    !mim install -q mmcv
    

    lower version of mmcv may not work, due to the newer versions of the default python and torch in colab.

  3. Try to build the mmdetect and mmpose from its source, therefore clone their repos. In another cell, run the following.

    !git clone https://github.com/open-mmlab/mmdetection.git
    !git clone https://github.com/open-mmlab/mmpose.git
    

    open-mmlab/mmpose

    OpenMMLab Pose Estimation Toolbox and Benchmark.

    Python
    6326
    1335

  4. Do a Editable Installation (-e) for mmdetect and mmpose.

    1. [You may no longer need it if more updates take place] Visit (/comtent)/mmdetection/mmdet/ folder. Inside __init__.py change '2.2.0' in the line mmcv_maximum_version = '2.2.0' (should be line 9) into '2.2.1 and ctrl+s or command+s to save.

    2. Then run the following to install.

      !pip install -q -e ./mmdetection
      !pip install -q -r ./mmpose/requirements.txt
      !pip install -q -e ./mmpose
      

Warning! May see some kind of mmdet.apis modules not found error during runs in Colab, likely due to sys.path not having the correct items in, run:

import sys
print(sys.path)
sys.path.append('/content/mmdetection')
sys.path.append('/content/mmpose')