mmagic

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.

https://github.com/open-mmlab/mmagic

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • ✓
    CITATION.cff file
    Found CITATION.cff file
  • ✓
    codemeta.json file
    Found codemeta.json file
  • ✓
    .zenodo.json file
    Found .zenodo.json file
  • â—‹
    DOI references
  • â—‹
    Academic publication links
  • ✓
    Committers with academic emails
    5 of 128 committers (3.9%) from academic institutions
  • â—‹
    Institutional organization owner
  • â—‹
    JOSS paper metadata
  • â—‹
    Scientific vocabulary similarity
    Low similarity (10.7%) to scientific vocabulary

Keywords

aigc computer-vision deep-learning diffusion diffusion-models generative-adversarial-network generative-ai image-editing image-generation image-processing image-synthesis inpainting matting pytorch super-resolution text2image video-frame-interpolation video-interpolation video-super-resolution

Keywords from Contributors

swin-transformer transformer vessel-segmentation semantic-segmentation retinal-vessel-segmentation realtime-segmentation pspnet medical-image-segmentation deeplabv3 self-supervised-learning
Last synced: 6 months ago · JSON representation ·

Repository

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.

Basic Info
Statistics
  • Stars: 7,257
  • Watchers: 96
  • Forks: 1,087
  • Open Issues: 69
  • Releases: 28
Topics
aigc computer-vision deep-learning diffusion diffusion-models generative-adversarial-network generative-ai image-editing image-generation image-processing image-synthesis inpainting matting pytorch super-resolution text2image video-frame-interpolation video-interpolation video-super-resolution
Created over 6 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

 
Multimodal Advanced, Generative, and Intelligent Creation (MMagic [em'mdk])
 
OpenMMLab website HOT      OpenMMLab platform TRY IT OUT
 
[![PyPI](https://badge.fury.io/py/mmagic.svg)](https://pypi.org/project/mmagic/) [![docs](https://img.shields.io/badge/docs-latest-blue)](https://mmagic.readthedocs.io/en/latest/) [![badge](https://github.com/open-mmlab/mmagic/workflows/build/badge.svg)](https://github.com/open-mmlab/mmagic/actions) [![codecov](https://codecov.io/gh/open-mmlab/mmagic/branch/master/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmagic) [![license](https://img.shields.io/github/license/open-mmlab/mmagic.svg)](https://github.com/open-mmlab/mmagic/blob/main/LICENSE) [![open issues](https://isitmaintained.com/badge/open/open-mmlab/mmagic.svg)](https://github.com/open-mmlab/mmagic/issues) [![issue resolution](https://isitmaintained.com/badge/resolution/open-mmlab/mmagic.svg)](https://github.com/open-mmlab/mmagic/issues) [![Open in OpenXLab](https://cdn-static.openxlab.org.cn/app-center/openxlab_demo.svg)](https://openxlab.org.cn/apps/detail/%E6%94%BF%E6%9D%B0/OpenMMLab-Projects) [Documentation](https://mmagic.readthedocs.io/en/latest/) | [Installation](https://mmagic.readthedocs.io/en/latest/get_started/install.html) | [Model Zoo](https://mmagic.readthedocs.io/en/latest/model_zoo/overview.html) | [Update News](https://mmagic.readthedocs.io/en/latest/changelog.html) | [Ongoing Projects](https://github.com/open-mmlab/mmagic/projects) | [Reporting Issues](https://github.com/open-mmlab/mmagic/issues) English | [](README_zh-CN.md)

What's New

New release MMagic v1.2.0 [18/12/2023]:

  • An advanced and powerful inpainting algorithm named PowerPaint is released in our repository. Click to View

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

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.

https://user-images.githubusercontent.com/49083766/233564593-7d3d48ed-e843-4432-b610-35e3d257765c.mp4

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 GANs applications. Its 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.

Best Practice

  • The best practice on our main branch works with Python 3.9+ and PyTorch 2.0+.

Back to Table of Contents

Contributing

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

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 Table of Contents

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.

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

Step 3. Verify MMagic has been successfully installed.

```shell 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!

python 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:

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

Please refer to installation for more detailed instruction.

Back to Table of Contents

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(Video) 3D-aware Generation

Please refer to model_zoo for more details.

Back to Table of Contents

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 Table of Contents

Citation

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

bibtex @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} }

bibtex @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 Table of Contents

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 Table of Contents

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 Table of Contents

Owner

  • Name: OpenMMLab
  • Login: open-mmlab
  • Kind: organization
  • Location: China

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: MMagic
    given-names: Contributors
title: "MMagic: OpenMMLab Multimodal Advanced, Generative, and Intelligent Creation Toolbox"
version: 1.0.0
date-released: 2023-04-25
url: "https://github.com/open-mmlab/mmagic"
license: Apache-2.0

GitHub Events

Total
  • Issues event: 2
  • Watch event: 352
  • Issue comment event: 10
  • Pull request event: 3
  • Fork event: 56
Last Year
  • Issues event: 2
  • Watch event: 352
  • Issue comment event: 10
  • Pull request event: 3
  • Fork event: 56

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 1,519
  • Total Committers: 128
  • Avg Commits per committer: 11.867
  • Development Distribution Score (DDS): 0.863
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
ys-li 5****i 208
hejiamin h****n@s****m 150
Z-Fran 4****n 137
Kelvin C.K. Chan k****n@o****m 123
LeoXing1996 x****6@h****m 115
wangxintao w****o@s****m 99
xurui4 x****4@s****m 93
WRH 1****i 80
rangoliu l****n 63
Yanhong Zeng z****0@g****m 62
lizz l****z@s****m 52
Yifei Yang 2****5@q****m 33
jiangliming j****g@s****m 29
wwhio w****o@l****m 25
chenkai c****i@s****m 19
nbei 6****5@q****m 18
yaochaorui y****i@s****m 11
Qunliang Xing r****l@g****m 8
VongolaWu v****7@g****m 7
jiaomenglei j****6@1****m 7
yangyifei P****i@s****g 7
quincylin1 3****1 7
xiaomile 1****5@1****m 5
Xu CAO 4****o 5
Kai Chen c****v@g****m 5
wangshiguang w****g@s****m 4
Ferry Huang 7****g 4
Xintao w****4@1****m 4
Zhengwentai SUN 3****d 4
zhuang2002 1****2 4
and 98 more...

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 162
  • Total pull requests: 190
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 22 days
  • Total issue authors: 121
  • Total pull request authors: 61
  • Average comments per issue: 2.28
  • Average comments per pull request: 1.31
  • Merged pull requests: 134
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 3
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 13 minutes
  • Issue authors: 3
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.33
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • zengyh1900 (8)
  • 11923303233 (5)
  • gvalvano (5)
  • limhasic (4)
  • plyfager (3)
  • XDUWQ (3)
  • Echolink50 (3)
  • Jay-Humor (3)
  • pekopoke (3)
  • okotaku (2)
  • txy00001 (2)
  • LoveU3tHousand2 (2)
  • zhuzhu18 (2)
  • XuanjiaZ (2)
  • Ashore-lz (2)
Pull Request Authors
  • liuwenran (30)
  • Z-Fran (22)
  • LeoXing1996 (11)
  • zengyh1900 (10)
  • xiaomile (6)
  • zhuang2002 (6)
  • okotaku (5)
  • FerryHuang (5)
  • xuan07472 (4)
  • SheffieldCao (4)
  • RangeKing (3)
  • sijiua (3)
  • jianyuhaohai (3)
  • aptsunny (3)
  • ryanxingql (3)
Top Labels
Issue Labels
kind/bug (75) kind/enhancement (32) kind/doc (17) good first issue (15) help wanted (14) kind/feature (7) priority/P0 (4) priority/P1 (2) status/WIP (2) info/1.x (2) status/need more info (2) status/need discussion (1)
Pull Request Labels
dependencies (3) kind/enhancement (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 852 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 24
  • Total maintainers: 1
proxy.golang.org: github.com/open-mmlab/mmagic
  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 0.9%
Forks count: 0.9%
Average: 5.2%
Dependent packages count: 8.4%
Dependent repos count: 10.6%
Last synced: 6 months ago
pypi.org: mmagic

OpenMMLab Multimodal Advanced, Generative, and Intelligent Creation Toolbox

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 2
  • Downloads: 852 Last month
Rankings
Stargazers count: 0.4%
Forks count: 1.3%
Average: 5.3%
Downloads: 5.5%
Dependent packages count: 7.3%
Dependent repos count: 11.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/lint.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/merge_stage_test.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v1.0.14 composite
  • mxschmitt/action-tmate v3 composite
.github/workflows/pr_stage_test.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v1.0.14 composite
.github/workflows/publish-to-pypi.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
.github/workflows/test_mim.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.circleci/docker/Dockerfile docker
  • pytorch/pytorch ${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel build
docker/Dockerfile docker
  • pytorch/pytorch ${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel build
requirements/docs.txt pypi
  • docutils ==0.16.0
  • mmcls ==0.10.0
  • myst_parser *
  • sphinx ==4.0.2
  • sphinx-copybutton *
  • sphinx_markdown_tables *
requirements/mminstall.txt pypi
  • mmcv-full >=1.3.17
requirements/readthedocs.txt pypi
  • lmdb *
  • mmcv *
  • regex *
  • scikit-image *
  • titlecase *
  • torch *
  • torchvision *
requirements/runtime.txt pypi
  • Pillow *
  • av ==8.0.3
  • av *
  • facexlib *
  • lmdb *
  • mmcv-full >=1.3.13
  • numpy *
  • opencv-python *
  • tensorboard *
  • torch *
  • torchvision *
requirements/tests.txt pypi
  • codecov * test
  • flake8 * test
  • interrogate * test
  • isort ==5.10.1 test
  • onnxruntime * test
  • pytest * test
  • pytest-runner * test
  • yapf * test
requirements/optional.txt pypi
  • PyQt5 *
  • albumentations *
  • imageio-ffmpeg ==0.4.4
  • mmdet >=3.0.0
  • open_clip_torch *
requirements.txt pypi
setup.py pypi