• Stars
    star
    6,575
  • Rank 5,758 (Top 0.2 %)
  • Language
    Jupyter Notebook
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OpenMMLab Multimodal Advanced, Generative, and Intelligent Creation Toolbox. Unlock the magic 🪄: Generative-AI (AIGC), easy-to-use APIs, awsome model zoo, diffusion models, for text-to-image generation, image/video restoration/enhancement, etc.
 
Multimodal Advanced, Generative, and Intelligent Creation (MMagic [em'mædʒɪk])
 
OpenMMLab website HOT      OpenMMLab platform TRY IT OUT
 

PyPI docs badge codecov license open issues issue resolution

📘Documentation | 🛠️Installation | 📊Model Zoo | 🆕Update News | 🚀Ongoing Projects | 🤔Reporting Issues

English | 简体中文

🚀 What's New

New release MMagic v1.0.1 [26/05/2023]:

  • Support tomesd for StableDiffusion speed-up.
  • Support all inpainting/matting/image restoration models inferencer.
  • Support animated drawings.
  • Support Style-Based Global Appearance Flow for Virtual Try-On.
  • Fix inferencer in pip-install.

We are excited to announce the release of MMagic v1.0.0 that inherits from MMEditing and MMGeneration.

After iterative updates with OpenMMLab 2.0 framework and merged with MMGeneration, MMEditing has become a powerful tool that supports low-level algorithms based on both GAN and CNN. Today, MMEditing embraces Generative AI and transforms into a more advanced and comprehensive AIGC toolkit: MMagic (Multimodal Advanced, Generative, and Intelligent Creation). MMagic will provide more agile and flexible experimental support for researchers and AIGC enthusiasts, and help you on your AIGC exploration journey.

We highlight the following new features.

1. New Models

We support 11 new models in 4 new tasks.

  • Text2Image / Diffusion
    • ControlNet
    • DreamBooth
    • Stable Diffusion
    • Disco Diffusion
    • GLIDE
    • Guided Diffusion
  • 3D-aware Generation
    • EG3D
  • Image Restoration
    • NAFNet
    • Restormer
    • SwinIR
  • Image Colorization
    • InstColorization

2. Magic Diffusion Model

For the Diffusion Model, we provide the following "magic" :

  • Support image generation based on Stable Diffusion and Disco Diffusion.
  • Support Finetune methods such as Dreambooth and DreamBooth LoRA.
  • Support controllability in text-to-image generation using ControlNet.
  • Support acceleration and optimization strategies based on xFormers to improve training and inference efficiency.
  • Support video generation based on MultiFrame Render.
  • Support calling basic models and sampling strategies through DiffuserWrapper.

3. Upgraded Framework

By using MMEngine and MMCV of OpenMMLab 2.0 framework, MMagic has upgraded in the following new features:

  • Refactor DataSample to support the combination and splitting of batch dimensions.
  • Refactor DataPreprocessor and unify the data format for various tasks during training and inference.
  • Refactor MultiValLoop and MultiTestLoop, supporting the evaluation of both generation-type metrics (e.g. FID) and reconstruction-type metrics (e.g. SSIM), and supporting the evaluation of multiple datasets at once.
  • Support visualization on local files or using tensorboard and wandb.
  • Support for 33+ algorithms accelerated by Pytorch 2.0.

MMagic has supported all the tasks, models, metrics, and losses in MMEditing and MMGeneration and unifies interfaces of all components based on MMEngine 😍.

Please refer to changelog.md for details and release history.

Please refer to migration documents to migrate from old version MMEditing 0.x to new version MMagic 1.x .

📄 Table of Contents

🔝Back to top

📖 Introduction

MMagic (Multimodal Advanced, Generative, and Intelligent Creation) is an advanced and comprehensive AIGC toolkit that inherits from MMEditing and MMGeneration. It is an open-source image and video editing&generating toolbox based on PyTorch. It is a part of the OpenMMLab project.

Currently, MMagic support multiple image and video generation/editing tasks.

mmagic_introduction.mp4

The best practice on our main branch works with Python 3.8+ and PyTorch 1.9+.

Major features

  • State of the Art Models

    MMagic provides state-of-the-art generative models to process, edit and synthesize images and videos.

  • Powerful and Popular Applications

    MMagic supports popular and contemporary image restoration, text-to-image, 3D-aware generation, inpainting, matting, super-resolution and generation applications. Specifically, MMagic supports fine-tuning for stable diffusion and many exciting diffusion's application such as ControlNet Animation with SAM. MMagic also supports GAN interpolation, GAN projection, GAN manipulations and many other popular GAN’s applications. It’s time to begin your AIGC exploration journey!

  • Efficient Framework

    By using MMEngine and MMCV of OpenMMLab 2.0 framework, MMagic decompose the editing framework into different modules and one can easily construct a customized editor framework by combining different modules. We can define the training process just like playing with Legos and provide rich components and strategies. In MMagic, you can complete controls on the training process with different levels of APIs. With the support of MMSeparateDistributedDataParallel, distributed training for dynamic architectures can be easily implemented.

🔝Back to top

🙌 Contributing

More and more community contributors are joining us to make our repo better. Some recent projects are contributed by the community including:

  • GLIDE is contributed by @Taited.
  • Restormer is contributed by @AlexZou14.
  • SwinIR is contributed by @Zdafeng.

Projects is opened to make it easier for everyone to add projects to MMagic.

We appreciate all contributions to improve MMagic. Please refer to CONTRIBUTING.md in MMCV and CONTRIBUTING.md in MMEngine for more details about the contributing guideline.

🔝Back to top

🛠️ Installation

MMagic depends on PyTorch, MMEngine and MMCV. Below are quick steps for installation.

Step 1. Install PyTorch following official instructions.

Step 2. Install MMCV, MMEngine and MMagic with MIM.

pip3 install openmim
mim install 'mmcv>=2.0.0'
mim install 'mmengine'
mim install 'mmagic'

Step 3. Verify MMagic has been successfully installed.

cd ~
python -c "import mmagic; print(mmagic.__version__)"
# Example output: 1.0.0

Getting Started

After installing MMagic successfully, now you are able to play with MMagic! To generate an image from text, you only need several lines of codes by MMagic!

from mmagic.apis import MMagicInferencer
sd_inferencer = MMagicInferencer(model_name='stable_diffusion')
text_prompts = 'A panda is having dinner at KFC'
result_out_dir = 'output/sd_res.png'
sd_inferencer.infer(text=text_prompts, result_out_dir=result_out_dir)

Please see quick run and inference for the basic usage of MMagic.

Install MMagic from source

You can also experiment on the latest developed version rather than the stable release by installing MMagic from source with the following commands:

git clone https://github.com/open-mmlab/mmagic.git
cd mmagic
pip3 install -e .

Please refer to installation for more detailed instruction.

🔝Back to top

📊 Model Zoo

Supported algorithms
Conditional GANs Unconditional GANs Image Restoration Image Super-Resolution
Video Super-Resolution Video Interpolation Image Colorization Image Translation
Inpainting Matting Text-to-Image 3D-aware Generation

Please refer to model_zoo for more details.

🔝Back to top

🤝 Acknowledgement

MMagic is an open source project that is contributed by researchers and engineers from various colleges and companies. We wish that the toolbox and benchmark could serve the growing research community by providing a flexible toolkit to reimplement existing methods and develop their own new methods.

We appreciate all the contributors who implement their methods or add new features, as well as users who give valuable feedbacks. Thank you all!

🔝Back to top

🖊️ Citation

If MMagic is helpful to your research, please cite it as below.

@misc{mmagic2023,
    title = {{MMagic}: {OpenMMLab} Multimodal Advanced, Generative, and Intelligent Creation Toolbox},
    author = {{MMagic Contributors}},
    howpublished = {\url{https://github.com/open-mmlab/mmagic}},
    year = {2023}
}
@misc{mmediting2022,
    title = {{MMEditing}: {OpenMMLab} Image and Video Editing Toolbox},
    author = {{MMEditing Contributors}},
    howpublished = {\url{https://github.com/open-mmlab/mmediting}},
    year = {2022}
}

🔝Back to top

🎫 License

This project is released under the Apache 2.0 license. Please refer to LICENSES for the careful check, if you are using our code for commercial matters.

🔝Back to top

🏗️ ️OpenMMLab Family

  • MMEngine: OpenMMLab foundational library for training deep learning models.
  • MMCV: OpenMMLab foundational library for computer vision.
  • MIM: MIM installs OpenMMLab packages.
  • MMPreTrain: OpenMMLab Pre-training Toolbox and Benchmark.
  • MMDetection: OpenMMLab detection toolbox and benchmark.
  • MMDetection3D: OpenMMLab's next-generation platform for general 3D object detection.
  • MMRotate: OpenMMLab rotated object detection toolbox and benchmark.
  • MMSegmentation: OpenMMLab semantic segmentation toolbox and benchmark.
  • MMOCR: OpenMMLab text detection, recognition, and understanding toolbox.
  • MMPose: OpenMMLab pose estimation toolbox and benchmark.
  • MMHuman3D: OpenMMLab 3D human parametric model toolbox and benchmark.
  • MMSelfSup: OpenMMLab self-supervised learning toolbox and benchmark.
  • MMRazor: OpenMMLab model compression toolbox and benchmark.
  • MMFewShot: OpenMMLab fewshot learning toolbox and benchmark.
  • MMAction2: OpenMMLab's next-generation action understanding toolbox and benchmark.
  • MMTracking: OpenMMLab video perception toolbox and benchmark.
  • MMFlow: OpenMMLab optical flow toolbox and benchmark.
  • MMagic: OpenMMLab Multimodal Advanced, Generative, and Intelligent Creation Toolbox.
  • MMDeploy: OpenMMLab model deployment framework.

🔝Back to top

More Repositories

1

mmdetection

OpenMMLab Detection Toolbox and Benchmark
Python
27,899
star
2

mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
Python
7,372
star
3

mmcv

OpenMMLab Computer Vision Foundation
Python
5,626
star
4

mmpose

OpenMMLab Pose Estimation Toolbox and Benchmark.
Python
4,969
star
5

mmdetection3d

OpenMMLab's next-generation platform for general 3D object detection.
Python
4,781
star
6

OpenPCDet

OpenPCDet Toolbox for LiDAR-based 3D Object Detection.
Python
4,342
star
7

mmocr

OpenMMLab Text Detection, Recognition and Understanding Toolbox
Python
4,099
star
8

Amphion

Amphion (/æmˈfaɪən/) is a toolkit for Audio, Music, and Speech Generation. Its purpose is to support reproducible research and help junior researchers and engineers get started in the field of audio, music, and speech generation research and development.
Python
3,947
star
9

mmaction2

OpenMMLab's Next Generation Video Understanding Toolbox and Benchmark
Python
3,903
star
10

mmtracking

OpenMMLab Video Perception Toolbox. It supports Video Object Detection (VID), Multiple Object Tracking (MOT), Single Object Tracking (SOT), Video Instance Segmentation (VIS) with a unified framework.
Python
3,384
star
11

mmpretrain

OpenMMLab Pre-training Toolbox and Benchmark
Python
3,138
star
12

mmselfsup

OpenMMLab Self-Supervised Learning Toolbox and Benchmark
Python
3,084
star
13

mmskeleton

A OpenMMLAB toolbox for human pose estimation, skeleton-based action recognition, and action synthesis.
Python
2,855
star
14

mmyolo

OpenMMLab YOLO series toolbox and benchmark. Implemented RTMDet, RTMDet-Rotated,YOLOv5, YOLOv6, YOLOv7, YOLOv8,YOLOX, PPYOLOE, etc.
Python
2,719
star
15

mmdeploy

OpenMMLab Model Deployment Framework
Python
2,520
star
16

mmaction

An open-source toolbox for action understanding based on PyTorch
Python
1,847
star
17

mmgeneration

MMGeneration is a powerful toolkit for generative models, based on PyTorch and MMCV.
Python
1,796
star
18

mmrotate

OpenMMLab Rotated Object Detection Toolbox and Benchmark
Python
1,724
star
19

Multimodal-GPT

Multimodal-GPT
Python
1,397
star
20

mmrazor

OpenMMLab Model Compression Toolbox and Benchmark.
Python
1,366
star
21

mmfashion

Open-source toolbox for visual fashion analysis based on PyTorch
Python
1,204
star
22

mmhuman3d

OpenMMLab 3D Human Parametric Model Toolbox and Benchmark
Python
1,129
star
23

mmengine

OpenMMLab Foundational Library for Training Deep Learning Models
Python
1,029
star
24

playground

A central hub for gathering and showcasing amazing projects that extend OpenMMLab with SAM and other exciting features.
Python
1,017
star
25

OpenMMLabCourse

OpenMMLab course index and stuff
Jupyter Notebook
919
star
26

mmflow

OpenMMLab optical flow toolbox and benchmark
Python
889
star
27

PIA

[CVPR 2024] PIA, your Personalized Image Animator. Animate your images by text prompt, combing with Dreambooth, achieving stunning videos. PIA,你的个性化图像动画生成器,利用文本提示将图像变为奇妙的动画
Python
716
star
28

mmfewshot

OpenMMLab FewShot Learning Toolbox and Benchmark
Python
662
star
29

awesome-vit

396
star
30

OpenUnReID

PyTorch open-source toolbox for unsupervised or domain adaptive object re-ID.
Python
389
star
31

labelbee-client

Out-of-the-box Annotation Toolbox
JavaScript
374
star
32

mim

MIM Installs OpenMMLab Packages
Python
329
star
33

denseflow

Extracting optical flow and frames
C++
286
star
34

MMGEN-FaceStylor

Python
245
star
35

mmeval

A unified evaluation library for multiple machine learning libraries
Python
243
star
36

labelbee

LabelBee is an annotation Library
TypeScript
223
star
37

OpenMMLabCamp

Jupyter Notebook
92
star
38

polynet

The Github Repo for PolyNet
77
star
39

CLUE

C++ Lightweight Utility Extensions
C++
70
star
40

mim-example

Python
57
star
41

mmengine-template

Python
47
star
42

ecosystem

36
star
43

mmstyles

Latex style file to facilitate writing of technical papers
TeX
36
star
44

mmpose-webcam-demo

Python
23
star
45

pre-commit-hooks

Python
17
star
46

mdformat-openmmlab

Python
8
star
47

.github

3
star