Using MMagic Inferencer on Kaggle

Dan Niles
2 min readJan 9, 2025

MMagic (Multimodal Advanced, Generative, and Intelligent Creation) is an open-source AIGC toolbox for professional AI researchers and machine learning engineers to explore image and video processing, editing and generation.

MMagic Inferencer provides access to various pre-trained models in computer vision. I faced challenges setting it up on a Kaggle notebook, but after some trial and error, I figured it out. In this article, I’ll walk you through the setup using their video super-resolution models as an example.

Please refer to this Kaggle Notebook for the code:

The MMagic library hasn’t been updated recently, so following the official installation instructions can lead to dependency conflicts. The simple fix is to install specific versions of the dependencies to get MMagic working.

First, install the following version of diffusers package:

!pip install diffusers==0.24.0

Then run the following:

!pip install mmcv==2.1.0
!pip install mmengine
!pip install mmagic

With this you should be good to go. You can import the MMagicInferencer using the following code:

from mmagic.apis import MMagicInferencer

model = MMagicInferencer('basicvsr')

You can view a list of supported models here:

With the setup complete, you can now use MMagic Inferencer to run various computer vision models. If you encounter any issues, checking the specific dependency versions should resolve most conflicts. Happy experimenting with MMagic!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Dan Niles
Dan Niles

Written by Dan Niles

Computer Science & Engineering Undergraduate @ University of Moratuwa, Sri Lanka

No responses yet

Write a response