mmdetection使用projects/gradio_demo

发布时间:2023年12月25日

我用google的colab搭建。

# Check nvcc version
!nvcc -V
# Check GCC version
!gcc --version

# install dependencies: (use cu111 because colab has CUDA 11.1)
%pip install -U openmim
!mim install "mmengine>=0.7.0"
!mim install "mmcv>=2.0.0rc4"

# Install mmdetection
!rm -rf mmdetection
!git clone https://github.com/open-mmlab/mmdetection.git
%cd mmdetection

%pip install -e .

?

from mmengine.utils import get_git_hash
from mmengine.utils.dl_utils import collect_env as collect_base_env

import mmdet


def collect_env():
    """Collect the information of the running environments."""
    env_info = collect_base_env()
    env_info['MMDetection'] = f'{mmdet.__version__}+{get_git_hash()[:7]}'
    return env_info


if __name__ == '__main__':
    for name, val in collect_env().items():
        print(f'{name}: {val}')

?千万注意,gradio安装3.50.0版本,太高或太低都会出问题。

%pip install "gradio==3.50.0"
!python projects/gradio_demo/launch.py

浏览器访问一下,一切正常

?

文章来源:https://blog.csdn.net/lanyan90/article/details/135205170
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。