mmdetection使用projects/gradio_demo

我用google的colab搭建。

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

mmdetection使用projects/gradio_demo_第1张图片

# 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 .

mmdetection使用projects/gradio_demo_第2张图片 

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}')

mmdetection使用projects/gradio_demo_第3张图片 千万注意,gradio安装3.50.0版本,太高或太低都会出问题。

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

mmdetection使用projects/gradio_demo_第4张图片

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

 

你可能感兴趣的:(目标检测)