【OpenMMLab】MMagic入门

1. 概述

OpenMMLab

  • 概述:OpenMMLab 是上海人工智能实验室的计算机视觉算法开源体系,是深度学习时代全球领域最全面、最具影响力的视觉算法开源项目,也是全球最大最全的开源计算机视觉算法库。
  • 特点
    • 丰富的算法库:已累计开源超过 30 个算法库,覆盖分类、检测、分割、视频理解等众多研究领域,拥有超过 300 种算法、2400 多个预训练模型。
    • 广泛的用户群体:在 GitHub 上获得超过 72000 个标星,吸引了超过 1500 名社区开发者参与项目贡献,用户遍及超过 110 个国家和地区,覆盖全球顶尖高校、研究机构和企业。
    • 统一的框架和易复现性:为学术和产业界提供一个可跨方向、结构精良、易复现的统一算法工具库,方便研究者和开发者进行算法的研究和应用。

【OpenMMLab】MMagic入门

SR(Super-Resolution,超分辨率)

  • 概述:在计算机视觉和图像处理领域,SR 指的是超分辨率技术,其目标是通过算法将低分辨率的图像或视频恢复成高分辨率的图像或视频,从而提高图像或视频的清晰度和质量。
  • 应用场景:广泛应用于图像和视频处理的各个领域,如监控安防、医学影像、卫星图像、视频娱乐等。例如,在监控安防领域,超分辨率技术可以将低分辨率的监控视频图像变得更清晰,有助于更好地识别和分析目标;在医学影像领域,超分辨率技术可以提高医学图像的分辨率,帮助医生更准确地诊断疾病。
  • 相关技术和算法:包括基于深度学习的方法,如 SRCNN、ESRGAN、EDVR 等。这些算法通过学习低分辨率图像和高分辨率图像之间的映射关系,能够有效地恢复出高分辨率的图像。

MMagic

  • 概述:是 OpenMMLab 下的一个多模态高级生成与智能创作工具箱。它是基于 OpenMMLab 2.0 框架开发的,继承了 MMediting 和 MMGeneration 的功能,并进一步发展成为一个强大的 AIGC(人工智能生成内容)工具。
  • 特点
    • 丰富的功能和模型:支持多种生成式 AI 任务,如文本到图像生成、图像和视频的修复 / 增强等。它包含了众多先进的模型,如 ControlNet、DreamBooth、Stable Diffusion 等,为用户提供了多样化的选择。
    • 易用的 API:提供了简单易用的 API,方便研究者和开发者快速上手,进行各种实验和应用开发。
    • 不断更新和发展:项目团队不断更新和改进 MMagic,发布新的功能和模型,以满足用户不断变化的需求。

欢迎来到 MMEditing 的中文文档! — MMEditing 文档 (zyhmmediting-zh.readthedocs.io)

之后发现MMGeneration与MMEditing合并为MMagic

概述 — MMagic 文档

2. 安装

安装教程 — MMagic 文档

2.1. 依赖

Linux / Windows / Mac


Python >= 3.7                                                 Python 3.8


PyTorch>= 1.8                                                 PyTorch 2.4

                                                                        torchvision 0.18.0

                                                                        cudatoolkit 12.1

(SR) C:\Users\吴伊晴>pip install torch==2.4 -i https://pypi.tuna.tsinghua.edu.cn/simple/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting torch==2.4
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c6/c2/841f6e76cdcefcefbed5211824a04e1d7cdb5712a74fa6e8fdaca6cfeaf7/torch-2.4.0-cp38-cp38-win_amd64.whl (198.1 MB)
Requirement already satisfied: filelock in d:\env\anaconda\envs\sr\lib\site-packages (from torch==2.4) (3.14.0)
Requirement already satisfied: typing-extensions>=4.8.0 in d:\env\anaconda\envs\sr\lib\site-packages (from torch==2.4) (4.12.2)
Collecting sympy (from torch==2.4)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/99/ff/c87e0622b1dadea79d2fb0b25ade9ed98954c9033722eb707053d310d4f3/sympy-1.13.3-py3-none-any.whl (6.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.2/6.2 MB 5.9 MB/s eta 0:00:00
Collecting networkx (from torch==2.4)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a8/05/9d4f9b78ead6b2661d6e8ea772e111fc4a9fbd866ad0c81906c11206b55e/networkx-3.1-py3-none-any.whl (2.1 MB)
Collecting jinja2 (from torch==2.4)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/31/80/3a54838c3fb461f6fec263ebf3a3a41771bd05190238de3486aae8540c36/jinja2-3.1.4-py3-none-any.whl (133 kB)
Collecting fsspec (from torch==2.4)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/1d/a0/6aaea0c2fbea2f89bfd5db25fb1e3481896a423002ebe4e55288907a97a3/fsspec-2024.9.0-py3-none-any.whl (179 kB)
Collecting MarkupSafe>=2.0 (from jinja2->torch==2.4)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/92/21/357205f03514a49b293e214ac39de01fadd0970a6e05e4bf1ddd0ffd0881/MarkupSafe-2.1.5-cp38-cp38-win_amd64.whl (17 kB)
Collecting mpmath<1.4,>=1.1.0 (from sympy->torch==2.4)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl (536 kB)
Installing collected packages: mpmath, sympy, networkx, MarkupSafe, fsspec, jinja2, torch
Successfully installed MarkupSafe-2.1.5 fsspec-2024.9.0 jinja2-3.1.4 mpmath-1.3.0 networkx-3.1 sympy-1.13.3 torch-2.4.0
(SR) C:\Users\吴伊晴>pip install torchvision==0.18.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting torchvision==0.18.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/80/ad/de37308a32ff3d6b0375469a1238d74365c60d1aca926bddcc91ec44c1ac/torchvision-0.18.0-cp38-cp38-win_amd64.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 4.9 MB/s eta 0:00:00
Requirement already satisfied: numpy in d:\env\anaconda\envs\sr\lib\site-packages (from torchvision==0.18.0) (1.24.4)
Collecting torch==2.3.0 (from torchvision==0.18.0)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/19/84/3495171f93b5449858c1c143dd8a48116da6973ebe222c00e1a98a080ba5/torch-2.3.0-cp38-cp38-win_amd64.whl (159.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 159.8/159.8 MB 2.9 MB/s eta 0:00:00
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in d:\env\anaconda\envs\sr\lib\site-packages (from torchvision==0.18.0) (10.4.0)
Requirement already satisfied: filelock in d:\env\anaconda\envs\sr\lib\site-packages (from torch==2.3.0->torchvision==0.18.0) (3.14.0)
Requirement already satisfied: typing-extensions>=4.8.0 in d:\env\anaconda\envs\sr\lib\site-packages (from torch==2.3.0->torchvision==0.18.0) (4.12.2)
Requirement already satisfied: sympy in d:\env\anaconda\envs\sr\lib\site-packages (from torch==2.3.0->torchvision==0.18.0) (1.13.3)
Requirement already satisfied: networkx in d:\env\anaconda\envs\sr\lib\site-packages (from torch==2.3.0->torchvision==0.18.0) (3.1)
Requirement already satisfied: jinja2 in d:\env\anaconda\envs\sr\lib\site-packages (from torch==2.3.0->torchvision==0.18.0) (3.1.4)
Requirement already satisfied: fsspec in d:\env\anaconda\envs\sr\lib\site-packages (from torch==2.3.0->torchvision==0.18.0) (2024.9.0)
Collecting mkl<=2021.4.0,>=2021.1.1 (from torch==2.3.0->torchvision==0.18.0)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fe/1c/5f6dbf18e8b73e0a5472466f0ea8d48ce9efae39bd2ff38cebf8dce61259/mkl-2021.4.0-py2.py3-none-win_amd64.whl (228.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 228.5/228.5 MB 1.8 MB/s eta 0:00:00
Collecting intel-openmp==2021.* (from mkl<=2021.4.0,>=2021.1.1->torch==2.3.0->torchvision==0.18.0)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/6f/21/b590c0cc3888b24f2ac9898c41d852d7454a1695fbad34bee85dba6dc408/intel_openmp-2021.4.0-py2.py3-none-win_amd64.whl (3.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.5/3.5 MB 3.0 MB/s eta 0:00:00
Collecting tbb==2021.* (from mkl<=2021.4.0,>=2021.1.1->torch==2.3.0->torchvision==0.18.0)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9b/24/84ce997e8ae6296168a74d0d9c4dde572d90fb23fd7c0b219c30ff71e00e/tbb-2021.13.1-py3-none-win_amd64.whl (286 kB)
Requirement already satisfied: MarkupSafe>=2.0 in d:\env\anaconda\envs\sr\lib\site-packages (from jinja2->torch==2.3.0->torchvision==0.18.0) (2.1.5)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in d:\env\anaconda\envs\sr\lib\site-packages (from sympy->torch==2.3.0->torchvision==0.18.0) (1.3.0)
Installing collected packages: tbb, intel-openmp, mkl, torch, torchvision
  Attempting uninstall: torch
    Found existing installation: torch 2.4.0
    Uninstalling torch-2.4.0:
      Successfully uninstalled torch-2.4.0
Successfully installed intel-openmp-2021.4.0 mkl-2021.4.0 tbb-2021.13.1 torch-2.3.0 torchvision-0.18.0

 CUDA 9.0 或更高                                            CUDA(GPU依赖)版本:12.1

(SR) C:\Users\吴伊晴>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Wed_Feb__8_05:53:42_Coordinated_Universal_Time_2023
Cuda compilation tools, release 12.1, V12.1.66
Build cuda_12.1.r12.1/compiler.32415258_0

mmcv>= 2.0.0

2.1. 创建环境

(base) C:\Users\吴伊晴>conda create --name SR python=3.8

2.2. openmim安装

(SR) C:\Users\吴伊晴>pip install openmim -i https://pypi.tuna.tsinghua.edu.cn/simple/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Collecting openmim
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/00/b3/95531cee452028869d0e08974561f83e9c256c98f62c7a45a51893a61c54/openmim-0.3.9-py2.py3-none-any.whl (52 kB)
Collecting Click (from openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl (97 kB)
Collecting colorama (from openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting model-index (from openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/0f/a6/4d4cbbef704f186d143e2859296a610a355992e4eae71582bd598093b36a/model_index-0.1.11-py3-none-any.whl (34 kB)
Collecting opendatalab (from openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/10/82/28fa3a91b7c4852fbad9ad32c7b49e4b1e212ab7ccf7296736da0935070d/opendatalab-0.0.10-py3-none-any.whl (29 kB)
Collecting pandas (from openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c3/6c/ea362eef61f05553aaf1a24b3e96b2d0603f5dc71a3bd35688a24ed88843/pandas-2.0.3-cp38-cp38-win_amd64.whl (10.8 MB)
Requirement already satisfied: pip>=19.3 in d:\env\anaconda\envs\sr\lib\site-packages (from openmim) (24.2)
Collecting requests (from openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl (64 kB)
Collecting rich (from openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/67/91/5474b84e505a6ccc295b2d322d90ff6aa0746745717839ee0c5fb4fdcceb/rich-13.9.2-py3-none-any.whl (242 kB)
Collecting tabulate (from openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/40/44/4a5f08c96eb108af5cb50b41f76142f0afa346dfa99d5296fe7202a11854/tabulate-0.9.0-py3-none-any.whl (35 kB)
Collecting pyyaml (from model-index->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/75/8a/ee831ad5fafa4431099aa4e078d4c8efd43cd5e48fbc774641d233b683a9/PyYAML-6.0.2-cp38-cp38-win_amd64.whl (162 kB)
Collecting markdown (from model-index->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3f/08/83871f3c50fc983b88547c196d11cf8c3340e37c32d2e9d6152abe2c61f7/Markdown-3.7-py3-none-any.whl (106 kB)
Collecting ordered-set (from model-index->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/33/55/af02708f230eb77084a299d7b08175cff006dea4f2721074b92cdb0296c0/ordered_set-4.1.0-py3-none-any.whl (7.6 kB)
Collecting pycryptodome (from opendatalab->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/43/1d/81d59d228381576b92ecede5cd7239762c14001a828bdba30d64896e9778/pycryptodome-3.21.0-cp36-abi3-win_amd64.whl (1.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 6.2 MB/s eta 0:00:00
Collecting tqdm (from opendatalab->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/48/5d/acf5905c36149bbaec41ccf7f2b68814647347b72075ac0b1fe3022fdc73/tqdm-4.66.5-py3-none-any.whl (78 kB)
Collecting openxlab (from opendatalab->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e2/9c/e48f8fef4c853afa6e509782f96efe75163157e7d80c89240b9913410bb5/openxlab-0.1.1-py3-none-any.whl (308 kB)
Collecting pywin32 (from opendatalab->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b7/e8/729b049e3c5c5449049d6036edf7a24a6ba785a9a1d5f617b638a9b444eb/pywin32-308-cp38-cp38-win_amd64.whl (6.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.6/6.6 MB 5.6 MB/s eta 0:00:00
Collecting charset-normalizer<4,>=2 (from requests->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/09/c8/0e17270496a05839f8b500c1166e3261d1226e39b698a735805ec206967b/charset_normalizer-3.4.0-cp38-cp38-win_amd64.whl (101 kB)
Collecting idna<4,>=2.5 (from requests->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl (70 kB)
Collecting urllib3<3,>=1.21.1 (from requests->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl (126 kB)
Collecting certifi>=2017.4.17 (from requests->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/12/90/3c9ff0512038035f59d279fddeb79f5f1eccd8859f06d6163c58798b9487/certifi-2024.8.30-py3-none-any.whl (167 kB)
Collecting python-dateutil>=2.8.2 (from pandas->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Collecting pytz>=2020.1 (from pandas->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/11/c3/005fcca25ce078d2cc29fd559379817424e94885510568bc1bc53d7d5846/pytz-2024.2-py2.py3-none-any.whl (508 kB)
Collecting tzdata>=2022.1 (from pandas->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a6/ab/7e5f53c3b9d14972843a647d8d7a853969a58aecc7559cb3267302c94774/tzdata-2024.2-py2.py3-none-any.whl (346 kB)
Collecting numpy>=1.20.3 (from pandas->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/69/65/0d47953afa0ad569d12de5f65d964321c208492064c38fe3b0b9744f8d44/numpy-1.24.4-cp38-cp38-win_amd64.whl (14.9 MB)
Collecting markdown-it-py>=2.2.0 (from rich->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Collecting pygments<3.0.0,>=2.13.0 (from rich->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f7/3f/01c8b82017c199075f8f788d0d906b9ffbbc5a47dc9918a945e13d5a2bda/pygments-2.18.0-py3-none-any.whl (1.2 MB)
Collecting typing-extensions<5.0,>=4.0.0 (from rich->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Collecting six>=1.5 (from python-dateutil>=2.8.2->pandas->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting importlib-metadata>=4.4 (from markdown->model-index->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a0/d9/a1e041c5e7caa9a05c925f4bdbdfb7f006d1f74996af53467bc394c97be7/importlib_metadata-8.5.0-py3-none-any.whl (26 kB)
Collecting filelock~=3.14.0 (from openxlab->opendatalab->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/41/24/0b023b6537dfc9bae2c779353998e3e99ac7dfff4222fc6126650e93c3f3/filelock-3.14.0-py3-none-any.whl (12 kB)
Collecting oss2~=2.17.0 (from openxlab->opendatalab->openmim)
  Using cached oss2-2.17.0-py3-none-any.whl
Collecting packaging~=24.0 (from openxlab->opendatalab->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/08/aa/cc0199a5f0ad350994d660967a8efb233fe0416e4639146c089643407ce6/packaging-24.1-py3-none-any.whl (53 kB)
Collecting pytz>=2020.1 (from pandas->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/3b/dd/9b84302ba85ac6d3d3042d3e8698374838bde1c386b4adb1223d7a0efd4e/pytz-2023.4-py2.py3-none-any.whl (506 kB)
Collecting requests (from openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d2/f4/274d1dbe96b41cf4e0efb70cbced278ffd61b5c7bb70338b62af94ccb25b/requests-2.28.2-py3-none-any.whl (62 kB)
Collecting rich (from openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/fc/1e/482e5eec0b89b593e81d78f819a9412849814e22225842b598908e7ac560/rich-13.4.2-py3-none-any.whl (239 kB)
Collecting setuptools~=60.2.0 (from openxlab->opendatalab->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/8e/16/8f64922c8d7cd7ec193b145c9b11ad281064ff8604452ba19a6d5bbd7ed9/setuptools-60.2.0-py3-none-any.whl (953 kB)
Collecting tqdm (from opendatalab->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c0/ab/bd9ba7f84c509c8b377628bc66696d52623e30c6c0830db3c78748eec4b4/tqdm-4.65.2-py3-none-any.whl (77 kB)
Collecting urllib3<1.27,>=1.21.1 (from requests->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/33/cf/8435d5a7159e2a9c83a95896ed596f68cf798005fe107cc655b5c5c14704/urllib3-1.26.20-py2.py3-none-any.whl (144 kB)
Collecting zipp>=3.20 (from importlib-metadata>=4.4->markdown->model-index->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/62/8b/5ba542fa83c90e09eac972fc9baca7a88e7e7ca4b221a89251954019308b/zipp-3.20.2-py3-none-any.whl (9.2 kB)
Collecting crcmod>=1.7 (from oss2~=2.17.0->openxlab->opendatalab->openmim)
  Using cached crcmod-1.7-cp38-cp38-win_amd64.whl
Collecting aliyun-python-sdk-kms>=2.4.1 (from oss2~=2.17.0->openxlab->opendatalab->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/11/5c/0132193d7da2c735669a1ed103b142fd63c9455984d48c5a88a1a516efaa/aliyun_python_sdk_kms-2.16.5-py2.py3-none-any.whl (99 kB)
Collecting aliyun-python-sdk-core>=2.13.12 (from oss2~=2.17.0->openxlab->opendatalab->openmim)
  Using cached aliyun_python_sdk_core-2.16.0-py3-none-any.whl
Collecting jmespath<1.0.0,>=0.9.3 (from aliyun-python-sdk-core>=2.13.12->oss2~=2.17.0->openxlab->opendatalab->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/07/cb/5f001272b6faeb23c1c9e0acc04d48eaaf5c862c17709d20e3469c6e0139/jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting cryptography>=3.0.0 (from aliyun-python-sdk-core>=2.13.12->oss2~=2.17.0->openxlab->opendatalab->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/cc/73/0eacbdc437202edcbdc07f3576ed8fb8b0ab79d27bf2c5d822d758a72faa/cryptography-43.0.1-cp37-abi3-win_amd64.whl (3.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 6.2 MB/s eta 0:00:00
Collecting cffi>=1.12 (from cryptography>=3.0.0->aliyun-python-sdk-core>=2.13.12->oss2~=2.17.0->openxlab->opendatalab->openmim)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2f/70/80c33b044ebc79527447fd4fbc5455d514c3bb840dede4455de97da39b4d/cffi-1.17.1-cp38-cp38-win_amd64.whl (181 kB)
Collecting pycparser (from cffi>=1.12->cryptography>=3.0.0->aliyun-python-sdk-core>=2.13.12->oss2~=2.17.0->openxlab->opendatalab->openmim)
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/13/a3/a812df4e2dd5696d1f351d58b8fe16a405b234ad2886a0dab9183fb78109/pycparser-2.22-py3-none-any.whl (117 kB)
Installing collected packages: pywin32, pytz, crcmod, zipp, urllib3, tzdata, typing-extensions, tabulate, six, setuptools, pyyaml, pygments, pycryptodome, pycparser, packaging, ordered-set, numpy, mdurl, jmespath, idna, filelock, colorama, charset-normalizer, certifi, tqdm, requests, python-dateutil, markdown-it-py, importlib-metadata, Click, cffi, rich, pandas, markdown, cryptography, model-index, aliyun-python-sdk-core, aliyun-python-sdk-kms, oss2, openxlab, opendatalab, openmim
  Attempting uninstall: setuptools
    Found existing installation: setuptools 75.1.0
    Uninstalling setuptools-75.1.0:
      Successfully uninstalled setuptools-75.1.0
Successfully installed Click-8.1.7 aliyun-python-sdk-core-2.16.0 aliyun-python-sdk-kms-2.16.5 certifi-2024.8.30 cffi-1.17.1 charset-normalizer-3.4.0 colorama-0.4.6 crcmod-1.7 cryptography-43.0.1 filelock-3.14.0 idna-3.10 importlib-metadata-8.5.0 jmespath-0.10.0 markdown-3.7 markdown-it-py-3.0.0 mdurl-0.1.2 model-index-0.1.11 numpy-1.24.4 opendatalab-0.0.10 openmim-0.3.9 openxlab-0.1.1 ordered-set-4.1.0 oss2-2.17.0 packaging-24.1 pandas-2.0.3 pycparser-2.22 pycryptodome-3.21.0 pygments-2.18.0 python-dateutil-2.9.0.post0 pytz-2023.4 pywin32-308 pyyaml-6.0.2 requests-2.28.2 rich-13.4.2 setuptools-60.2.0 six-1.16.0 tabulate-0.9.0 tqdm-4.65.2 typing-extensions-4.12.2 tzdata-2024.2 urllib3-1.26.20 zipp-3.20.2

2.3. mmcv-full安装

mmcv就是一个框架(在终端中pip安装那种),需要根据具体情况选择版本

MMagic要求mmcv>= 2.0.0

(SR) C:\Users\吴伊晴>pip install mmcv==2.2.0 -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.4/index.html -i https://pypi.tuna.tsinghua.edu.cn/simple/
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/
Looking in links: https://download.openmmlab.com/mmcv/dist/cu121/torch2.4/index.html
Collecting mmcv==2.2.0
  Using cached mmcv-2.2.0-cp38-cp38-win_amd64.whl
Requirement already satisfied: addict in d:\env\anaconda\envs\sr\lib\site-packages (from mmcv==2.2.0) (2.4.0)
Requirement already satisfied: mmengine>=0.3.0 in d:\env\anaconda\envs\sr\lib\site-packages (from mmcv==2.2.0) (0.10.5)
Requirement already satisfied: numpy in d:\env\anaconda\envs\sr\lib\site-packages (from mmcv==2.2.0) (1.24.4)
Requirement already satisfied: packaging in d:\env\anaconda\envs\sr\lib\site-packages (from mmcv==2.2.0) (24.1)
Requirement already satisfied: Pillow in d:\env\anaconda\envs\sr\lib\site-packages (from mmcv==2.2.0) (10.4.0)
Requirement already satisfied: pyyaml in d:\env\anaconda\envs\sr\lib\site-packages (from mmcv==2.2.0) (6.0.2)
Requirement already satisfied: yapf in d:\env\anaconda\envs\sr\lib\site-packages (from mmcv==2.2.0) (0.40.2)
Requirement already satisfied: opencv-python>=3 in d:\env\anaconda\envs\sr\lib\site-packages (from mmcv==2.2.0) (4.10.0.84)
Requirement already satisfied: regex in d:\env\anaconda\envs\sr\lib\site-packages (from mmcv==2.2.0) (2024.9.11)
Requirement already satisfied: matplotlib in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine>=0.3.0->mmcv==2.2.0) (3.7.5)
Requirement already satisfied: rich in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine>=0.3.0->mmcv==2.2.0) (13.4.2)
Requirement already satisfied: termcolor in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine>=0.3.0->mmcv==2.2.0) (2.4.0)
Requirement already satisfied: importlib-metadata>=6.6.0 in d:\env\anaconda\envs\sr\lib\site-packages (from yapf->mmcv==2.2.0) (8.5.0)
Requirement already satisfied: platformdirs>=3.5.1 in d:\env\anaconda\envs\sr\lib\site-packages (from yapf->mmcv==2.2.0) (4.3.6)
Requirement already satisfied: tomli>=2.0.1 in d:\env\anaconda\envs\sr\lib\site-packages (from yapf->mmcv==2.2.0) (2.0.2)
Requirement already satisfied: zipp>=3.20 in d:\env\anaconda\envs\sr\lib\site-packages (from importlib-metadata>=6.6.0->yapf->mmcv==2.2.0) (3.20.2)
Requirement already satisfied: contourpy>=1.0.1 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.2.0) (1.1.1)
Requirement already satisfied: cycler>=0.10 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.2.0) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.2.0) (4.54.1)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.2.0) (1.4.7)
Requirement already satisfied: pyparsing>=2.3.1 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.2.0) (3.1.4)
Requirement already satisfied: python-dateutil>=2.7 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.2.0) (2.9.0.post0)
Requirement already satisfied: importlib-resources>=3.2.0 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.2.0) (6.4.5)
Requirement already satisfied: markdown-it-py>=2.2.0 in d:\env\anaconda\envs\sr\lib\site-packages (from rich->mmengine>=0.3.0->mmcv==2.2.0) (3.0.0)
Requirement already satisfied: pygments<3.0.0,>=2.13.0 in d:\env\anaconda\envs\sr\lib\site-packages (from rich->mmengine>=0.3.0->mmcv==2.2.0) (2.18.0)
Requirement already satisfied: typing-extensions<5.0,>=4.0.0 in d:\env\anaconda\envs\sr\lib\site-packages (from rich->mmengine>=0.3.0->mmcv==2.2.0) (4.12.2)
Requirement already satisfied: mdurl~=0.1 in d:\env\anaconda\envs\sr\lib\site-packages (from markdown-it-py>=2.2.0->rich->mmengine>=0.3.0->mmcv==2.2.0) (0.1.2)
Requirement already satisfied: six>=1.5 in d:\env\anaconda\envs\sr\lib\site-packages (from python-dateutil>=2.7->matplotlib->mmengine>=0.3.0->mmcv==2.2.0) (1.16.0)
Installing collected packages: mmcv
Successfully installed mmcv-2.2.0

2.3. mmengine安装 

(SR) C:\Users\吴伊晴>mim install mmengine
Looking in links: https://download.openmmlab.com/mmcv/dist/cpu/torch2.4.0/index.html
Requirement already satisfied: mmengine in d:\env\anaconda\envs\sr\lib\site-packages (0.10.5)
Requirement already satisfied: addict in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine) (2.4.0)
Requirement already satisfied: matplotlib in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine) (3.7.5)
Requirement already satisfied: numpy in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine) (1.24.4)
Requirement already satisfied: pyyaml in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine) (6.0.2)
Requirement already satisfied: rich in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine) (13.4.2)
Requirement already satisfied: termcolor in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine) (2.4.0)
Requirement already satisfied: yapf in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine) (0.40.2)
Requirement already satisfied: opencv-python>=3 in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine) (4.10.0.84)
Requirement already satisfied: regex in d:\env\anaconda\envs\sr\lib\site-packages (from mmengine) (2024.9.11)
Requirement already satisfied: contourpy>=1.0.1 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine) (1.1.1)
Requirement already satisfied: cycler>=0.10 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine) (4.54.1)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine) (1.4.7)
Requirement already satisfied: packaging>=20.0 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine) (24.1)
Requirement already satisfied: pillow>=6.2.0 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine) (10.4.0)
Requirement already satisfied: pyparsing>=2.3.1 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine) (3.1.4)
Requirement already satisfied: python-dateutil>=2.7 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine) (2.9.0.post0)
Requirement already satisfied: importlib-resources>=3.2.0 in d:\env\anaconda\envs\sr\lib\site-packages (from matplotlib->mmengine) (6.4.5)
Requirement already satisfied: markdown-it-py>=2.2.0 in d:\env\anaconda\envs\sr\lib\site-packages (from rich->mmengine) (3.0.0)
Requirement already satisfied: pygments<3.0.0,>=2.13.0 in d:\env\anaconda\envs\sr\lib\site-packages (from rich->mmengine) (2.18.0)
Requirement already satisfied: typing-extensions<5.0,>=4.0.0 in d:\env\anaconda\envs\sr\lib\site-packages (from rich->mmengine) (4.12.2)
Requirement already satisfied: importlib-metadata>=6.6.0 in d:\env\anaconda\envs\sr\lib\site-packages (from yapf->mmengine) (8.5.0)
Requirement already satisfied: platformdirs>=3.5.1 in d:\env\anaconda\envs\sr\lib\site-packages (from yapf->mmengine) (4.3.6)
Requirement already satisfied: tomli>=2.0.1 in d:\env\anaconda\envs\sr\lib\site-packages (from yapf->mmengine) (2.0.2)
Requirement already satisfied: zipp>=3.20 in d:\env\anaconda\envs\sr\lib\site-packages (from importlib-metadata>=6.6.0->yapf->mmengine) (3.20.2)
Requirement already satisfied: mdurl~=0.1 in d:\env\anaconda\envs\sr\lib\site-packages (from markdown-it-py>=2.2.0->rich->mmengine) (0.1.2)
Requirement already satisfied: six>=1.5 in d:\env\anaconda\envs\sr\lib\site-packages (from python-dateutil>=2.7->matplotlib->mmengine) (1.16.0)

2.4. MMEditing安装

克隆 MMEditing 仓库

(SR) C:\Users\吴伊晴>git clone https://github.com/open-mmlab/mmediting.git

此时可以看到该仓库的文件已经下载到该路径了 

进入文件夹 

(SR) C:\Users\吴伊晴>cd mmediting

(SR) C:\Users\吴伊晴\mmediting>

安装相关依赖

(SR) C:\Users\吴伊晴\mmediting>pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/

安装MMEditing

(SR) C:\Users\吴伊晴\mmediting>pip install -v -e .

这里显示成功安装的是MMagic1.2.0

那么MMagic和MMEditing有什么关系呢?

open-mmlab/mmagic:OpenMMLab 多模态高级、生成和智能创作工具箱。解锁魔力

版权声明:如无特殊标注,文章均来自网络,本站编辑整理,转载时请以链接形式注明文章出处,请自行分辨。

本文链接:https://www.shbk5.com/dnsj/73880.html