OpenMMLab MMDetectionV3.1.0-SAM(环境安装、模型测试、训练以及模型后处理工具)

OpenMMLab Playground

概况

在这里插入图片描述
当前通用目标检测的研究方向正在朝着大型多模态模型发展。除了图像输入之外,最近的研究成果还结合了文本模式来提高性能。添加文本模态后,通用检测算法的一些非常好的属性开始出现,例如:

可以利用大量易于访问的文本数据进行联合训练。
轻松实现开放集目标检测,从而实现真正通用的检测任务。
可以与 NLP 中的优秀模型一起使用来创建一些有趣且有用的功能。

从目前来看,通用物体检测可以分为两大类:

(1)闭集目标检测,只能检测训练集中出现的固定数量类别的目标
(2)开放集目标检测,还可以检测不在训练集中的对象和类别

随着多模态算法的流行,开放集目标检测成为一个新的研究领域,其中有三个热门方向:
(1)零样本目标检测(Zero-Shot Object Detection),也称为零样本目标检测,强调测试集中的目标类别不在训练集中。
(2)开放词汇对象检测(Open-Vocabulary Object Detection),检测目标图像中出现的具有给定类别列表的所有对象
(3)接地对象检测(Grounding Object Detection),通过目标图像中出现的给定文本描述来预测对象的位置

这三个方向在实践中并不能完全区分,只是一般意义上的不同。基于以上描述,我们提供了多种模型的推理和评估脚本,与Segment Anything配合使用,实现了以下功能:

(1)支持 MMDet 中经典的 Closed-Set 对象检测模型,与 SAM 模型配合使用,以进行自动检测和实例分割,例如 Faster R-CNN 和 DINO。
(2)支持 Open-Vocabulary 检测模型(如 Detic)与 SAM 模型配合使用,以进行自动检测和实例分割。
(3)支持 Grounding 物体检测模型与 SAM 模型配合使用,进行自动检测和实例分割,例如 Grounding DINO 和 GLIP。
(4)支持跨所有模型的分布式检测和分段评估以及自动 COCO JSON 导出,以实现用户友好的自定义数据评估

File Introduction(代码介绍)

在这里插入图片描述

(1)detector_sam_demo.py:用于对单个图像和图像文件夹进行检测和实例分割。
(2)coco_style_eval.py:用于对给定的 COCO JSON 进行推理、评估和导出。
(3)browse_coco_json.py:用于可视化导出的 COCO JSON。
(4)images2coco.py:用于基于用户自己的图像文件夹的自定义和未注释的 COCO 风格 JSON。此 JSON 可以用作coco_style_eval.py.

环境搭建

conda create -n mmdetsam python=3.8 -y
conda activate mmdetsam
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html
pip install mmengine  -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

git clone https://github.com/open-mmlab/playground.git
cd playground

功能介绍

该项目包含了许多优秀的开源算法,以减轻环境安装的负担。如果您不想使用某部分功能,可以跳过相应部分。我们的项目可以分为以下三个部分。

1 开放词汇+SAM(Open-Vocabulary + SAM)

将开放词汇目标检测器与 SAM 模型结合使用。目前我们支持 Detic。
依赖安装

pip install -U openmim  -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
mim install "mmcv>=2.0.0"  -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

# build from source
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection; pip install -e .; cd ..

pip install git+https://github.com/facebookresearch/segment-anything.git
pip install git+https://github.com/openai/CLIP.git
验证mmdetection安装成功
python demo/image_demo.py demo/demo.jpg rtmdet_tiny_8xb32-300e_coco.py --weights rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth --device cpu

在这里插入图片描述

Demonstration
cd mmdet_sam

# download weights
mkdir ../models
wget -P ../models/ https://download.openmmlab.com/mmdetection/v3.0/detic/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth
wget -P ../models/ https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth

####input a single image
python detector_sam_demo.py ../images/cat_remote.jpg \
    configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py \
    ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth \
    -t cat \
    --sam-device cpu
python detector_sam_demo.py ../images/cat_remote.jpg configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py  ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth  -t cat 

在这里插入图片描述
我们还可以通过编辑–test-prompt来检测遥控器。请注意,您必须使用空白区域并.分隔不同的类别。

# input a single image
python detector_sam_demo.py ../images/cat_remote.jpg \
    configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py \
    ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth \
    -t "cat . remote" \
    --sam-device cpu
python detector_sam_demo.py ../images/cat_remote.jpg configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth -t "cat . remote" --sam-device cpu

在这里插入图片描述

python detector_sam_demo.py ../images/hengxuhe-20190411___1920___1920_24.jpg  configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py  ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth  -t ship

在这里插入图片描述

您还可以使用以下命令对文件夹运行推理:

# input a folder
python detector_sam_demo.py ../images configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth -t "cat . remote" --sam-device cpu

如果您的 GPU 的显存只能支持运行一种模型,您可以使用以下方法–cpu-off-load来确保每次 GPU 上都只运行一种模型:

# input a folder
python detector_sam_demo.py ../images \
    configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py \
    ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth \
    -t "cat . remote" \
    --cpu-off-load

我们还通过使用支持 CPU 推理–det-device cpu 。

由于 Detic 包含掩模结果,因此我们添加了一个附加参数–use-detic-mask。这允许我们只运行 Detic,而不运行 SAM 模型。

# input a folder
python detector_sam_demo.py ../images \
    configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py \
    ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth \
    -t "cat . remote" \
    --det-device cpu \
    --use-detic-mask
# input a folder
python detector_sam_demo.py ../images configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth -t "cat . remote" --det-device cpu --use-detic-mask

如果您只想可视化结果,可以使用 set–only-det来运行而不使用 SAM 模型。

# input a sinle image
python detector_sam_demo.py ../images/cat_remote.jpg \
    configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py \
    ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth \
    -t "cat" \
    --only-det

在这里插入图片描述

2 MMdet models + SAM

将 MMDet 模型与 SAM 模型结合使用来执行实例分割任务。目前支持所有 MMDet 模型。

依赖安装

pip install -U openmim
mim install "mmcv>=2.0.0"

# build from source(安装的是v3.1.0)
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection; pip install -e .; cd ..

在这里插入图片描述

Demonstration

您可以运行我们在上面的 Detic 部分中介绍的所有功能。唯一的区别是您不需要设置–text-prompt。这里我们演示一些经典用法。

Faster R-CNN models
cd mmdet_sam

mkdir ../models
wget -P ../models/ https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_2x_coco/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth

# input a single image
python detector_sam_demo.py ../images/cat_remote.jpg \
    ../mmdetection/configs/faster_rcnn/faster-rcnn_r50_fpn_2x_coco.py \
    ../models/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth \
    --sam-device cpu
python detector_sam_demo.py ../images/cat_remote.jpg ../mmdetection/configs/faster_rcnn/faster-rcnn_r50_fpn_2x_coco.py ../models/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth --sam-device cpu

运行结果:目前看来先检测后分割会存在分割目标不全的问题。
在这里插入图片描述

DINO models
cd mmdet_sam

mkdir ../models
wget -P ../models/ https://download.openmmlab.com/mmdetection/v3.0/dino/dino-5scale_swin-l_8xb2-12e_coco/dino-5scale_swin-l_8xb2-12e_coco_20230228_072924-a654145f.pth

# input a single image
python detector_sam_demo.py ../images/cat_remote.jpg \
    ../mmdetection/configs/dino/dino-5scale_swin-l_8xb2-12e_coco.py \
    dino-5scale_swin-l_8xb2-12e_coco_20230228_072924-a654145f.pth  \
    --sam-device cpu
python detector_sam_demo.py ../images/cat_remote.jpg ../mmdetection/configs/dino/dino-5scale_swin-l_8xb2-12e_coco.py  ../models/dino-5scale_swin-l_8xb2-12e_coco_20230228_072924-a654145f.pth --sam-device cpu

在这里插入图片描述

3 Grounding models + SAM

将接地物体检测器与 SAM 模型结合使用来执行实例分割任务。目前我们支持 Grounding DINO 和 GLIP。

依赖安装

Grounding DINO:
cd playground
pip install git+https://github.com/facebookresearch/segment-anything.git 
pip install git+https://github.com/IDEA-Research/GroundingDINO.git  -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
# Please make sure your PyTorch, GCC and NVCC are all compatible to build CUDA ops successfully
GLIP:
cd playground

pip install git+https://github.com/facebookresearch/segment-anything.git
pip install einops shapely timm yacs tensorboardX ftfy prettytable pymongo transformers nltk inflect scipy pycocotools opencv-python matplotlib

git clone https://github.com/microsoft/GLIP.git
cd GLIP; python setup.py build develop --user # Please make sure your PyTorch, GCC and NVCC are all compatible to build CUDA ops successfully

Demonstration

不过,用法与 Detic 部分相同,我们在这里仅演示部分功能。

cd mmdet_sam

mkdir ../models
wget -P ../models/ https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth

# input a single image
python detector_sam_demo.py ../images/cat_remote.jpg \
    configs/GroundingDINO_SwinT_OGC.py \
    ../models/groundingdino_swint_ogc.pth \
    -t "cat . remote" \
    --sam-device cpu
python detector_sam_demo.py ../images/cat_remote.jpg configs/GroundingDINO_SwinT_OGC.py ../models/groundingdino_swint_ogc.pth -t "cat . remote" --sam-device cpu

结果将outputs/cat_remote.jpg如下生成:

cd mmdet_sam

mkdir ../models
wget -P ../models/ https://penzhanwu2bbs.blob.core.windows.net/data/GLIPv1_Open/models/glip_a_tiny_o365.pth

# input a single image
python detector_sam_demo.py ../images/cat_remote.jpg \
    configs/glip_A_Swin_T_O365.yaml \
    ../models/glip_a_tiny_o365.pth \
    -t "cat . remote" \
    --sam-device cpu

4 COCO JSON评估

我们支持coco_style_eval.py分布式和非分布式方式运行。默认情况下,该脚本在按如下格式组织的 COCO Val2017 数据集上运行:
├── ${COCO_DATA_ROOT}
│ ├── annotations
│ ├──── instances_val2017.json
│ ├── val2017

cd mmdet_sam

# non-distributed
python coco_style_eval.py ${COCO_DATA_ROOT} \
    configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py \
    ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth \
    -t coco_cls_name.txt

# distributed on eight cards on one machine
bash ./dist_coco_style_eval.sh 8 ${COCO_DATA_ROOT} \
    configs/Detic_LI21k_CLIP_SwinB_896b32_4x_ft4x_max-size.py \
    ../models/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth \
    -t coco_cls_name.txt

6 Custom dataset

Data prepare

使用以下命令下载 cat 数据集:

cd playground

wget https://download.openmmlab.com/mmyolo/data/cat_dataset.zip
mkdir data
unzip cat_dataset.zip -d data/cat
rm cat_dataset.zip

Note:,Need to replace 1 cat with cat in cat/class_with_id.txt

使用images2coco.py脚本生成无标签的json文件:

cd mmdet_sam
python images2coco.py ../data/cat/images ../data/cat/class_with_id.txt cat_coco.json

推理

这里我们以GroundingDINO和SAM模型为例进行推理,得到预测json文件:

python coco_style_eval.py ../data/cat/ \
      configs/GroundingDINO_SwinT_OGC.py \
      ../models/groundingdino_swint_ogc.pth \
      -t ../data/cat/class_with_id.txt \
      --data-prefix images \
      --ann-file annotations/cat_coco.json \
      --out-dir ../cat_pred \
      --sam-device cpu

MMRotate-SAM概况

在这里插入图片描述

我们提供了一套基于MMRotate和SAM的应用程序。其特点包括:
在这里插入图片描述

支持使用 SAM 进行零样本目标检测。
在单个图像上执行基于 SAM 的零样本面向对象检测推理。
在这里插入图片描述
eval_zero-shot-oriented-detection_dota.py使用 SAM 实施面向零样本的目标检测。它向 SAM 提示来自水平物体检测器的预测框。
demo_zero-shot-oriented-detection.py使用 SAM 进行零样本定向物体检测的推理单图像。
data_builder保存数据集、数据加载器的配置信息和进程。

pip install opencv-python pycocotools matplotlib onnxruntime onnx -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

您还可以选择从源代码安装MMRotate

git clone https://github.com/open-mmlab/mmrotate.git
cd mmrotate; pip install -e .; cd ..

用法

用单张图像推理MMRotate-SAM并获得可视化结果。

# download weights
cd mmrotate_sam

mkdir ../models
wget -P ../models https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth
wget -P ../models https://download.openmmlab.com/mmrotate/v0.1.0/rotated_fcos/rotated_fcos_sep_angle_r50_fpn_1x_dota_le90/rotated_fcos_sep_angle_r50_fpn_1x_dota_le90-0be71a0c.pth

# demo
python demo_zero-shot-oriented-detection.py \
    ../mmrotate/data/split_ss_dota/test/images/P0006__1024__0___0.png \
    ../mmrotate/configs/rotated_fcos/rotated-fcos-hbox-le90_r50_fpn_1x_dota.py \
    ../models/rotated_fcos_sep_angle_r50_fpn_1x_dota_le90-0be71a0c.pth \
    --sam-type "vit_b" --sam-weight ../models/sam_vit_b_01ec64.pth --out-path output.png

在这里插入图片描述

评估DOTA数据集上的定量评价指标。

python eval_zero-shot-oriented-detection_dota.py \
    ../mmrotate/configs/rotated_fcos/rotated-fcos-hbox-le90_r50_fpn_1x_dota.py \
    ../models/rotated_fcos_sep_angle_r50_fpn_1x_dota_le90-0be71a0c.pth \
    --sam-type "vit_b" --sam-weight ../models/sam_vit_b_01ec64.pth

Open-Tracking概况

我们提供了一种基于开放对象检测并利用运动信息(卡尔曼滤波器)进行多对象跟踪的方法。
在这里插入图片描述
借助开放对象检测和利用运动信息(卡尔曼滤波器),可以执行多对象跟踪。由于时间限制,目前仅支持GroundingDINO、GLIP、Detic结合ByteTrack进行追踪。
在这里插入图片描述

参数说明
tracking_demo.py:用于视频或图像文件夹上的多对象跟踪推理。

基础开发环境设置

pip install -U openmim
mim install "mmcv>=2.0.0"

# build from source
cd playground
git clone -b tracking https://github.com/open-mmlab/mmdetection.git
cd mmdetection; pip install -e .; cd ..
pip install lap seaborn

Grounding Dino Dependencies Installation

cd playground
pip install git+https://github.com/IDEA-Research/GroundingDINO.git

如果由于网络原因无法使用pip下载,可以选择以下方法代替。

git clone git+https://github.com/IDEA-Research/GroundingDINO.git
cd GroundingDINO
python setup.py install

GLIP 依赖​​项安装

cd playground
pip install einops shapely timm yacs tensorboardX ftfy prettytable pymongo transformers nltk inflect scipy pycocotools opencv-python matplotlib

git clone https://github.com/microsoft/GLIP.git
cd GLIP; python setup.py build develop --user; cd ..

SAM Dependencies Installation

pip install git+https://github.com/facebookresearch/segment-anything.git

If you can’t use pip to download due to network reasons, you can choose the following method instead.

git clone git+https://github.com/facebookresearch/segment-anything.git
cd segment-anything
python setup.py install

获取演示视频和图片

cd playground
wget https://download.openmmlab.com/playground/mmtracking/tracking_demo.zip
unzip tracking_demo.zip

下载权重

mkdir ../models
wget -P ../models/ https://download.openmmlab.com/mmdetection/v3.0/detic/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k/detic_centernet2_swin-b_fpn_4x_lvis-coco-in21k_20230120-0d301978.pth
wget -P ../models/ https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
wget -P ../models/ https://penzhanwu2bbs.blob.core.windows.net/data/GLIPv1_Open/models/glip_a_tiny_o365.pth
wget -P ../models/ https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha2/groundingdino_swinb_cogcoor.pth

模型推理演示

仅使用 GroundingDINO 作为示例。
MOT

cd mmtracking_open_detection

# input a video
python tracking_demo.py "../tracking_demo/mot_challenge_track.mp4" "configs/GroundingDINO_SwinB.cfg.py" "../models/groundingdino_swinb_cogcoor.pth"  --text-prompt "person . rider . car . truck . bus . train . motorcycle . bicycle ." --out-dir "outputs/mot_challenge" --init_track_thr 0.35 --obj_score_thrs_high 0.3

# input a images folder
python tracking_demo.py "../tracking_demo/bdd_val_track" "configs/GroundingDINO_SwinB.cfg.py" "../models/groundingdino_swinb_cogcoor.pth"  --text-prompt "person . rider . car . truck . bus . train . motorcycle . bicycle ." --out-dir "outputs/bdd100k" --fps 30

MOTS

cd mmtracking_open_detection

# input a images folder
python tracking_demo.py "../tracking_demo/bdd_val_track" "configs/GroundingDINO_SwinB.cfg.py" "../models/groundingdino_swinb_cogcoor.pth"  --text-prompt "person . rider . car . truck . bus . train . motorcycle . bicycle ." --out-dir "outputs/bdd100k" --fps 30 --mots

MMagic-SAM概述

在这里插入图片描述
我们提供了一套基于MMEditing和SAM的应用程序。其特点包括:

使用 MMEditing 界面生成图像。
将 SAM 生成的蒙版与 MMEditing 的图像编辑功能相结合,创建新图片。

# create env and install torch
conda create -n mmedit-sam python=3.8 -y
conda activate mmedit-sam
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113

# install mmagic
pip install openmim
mim install mmengine "mmcv>=2.0.0"
git clone -b dev-1.x https://github.com/open-mmlab/mmagic.git
pip install -e ./mmagic

# install sam
pip install git+https://github.com/facebookresearch/segment-anything.git

# you may need ffmpeg to get frames or make video
sudo apt install ffmpeg

使用 SAM 播放 controlnet 动画

找到您要编辑的视频剪辑并获取帧

mkdir -p inputs/demo_video
ffmpeg -i your_video.mp4 inputs/demo_video/%04d.jpg

运行脚本。

python play_controlnet_animation_sam.py

使用输出帧制作视频。

ffmpeg -r 10 -i results/final_frames/%04d.jpg -b:v 30M -vf fps=10 results/final_frames.mp4

在这里插入图片描述
我们通过以下步骤得到最终的视频:

(1)将输入视频分割成帧
(2)通过MMagic的推理API调用controlnet动画模型修改视频的每一帧,使其成为AI动画
(3)使用MMagic中的稳定扩散生成符合动画内容语义的背景图像
(4)使用SAM预测动画中人物的面具
(5)将动画中的背景替换为我们生成的背景图片

MMOCR-SAM概述

在这里插入图片描述
该项目是从OCR-SAM迁移而来的,它结合了 MMOCR 和 Segment Anything。我们提供了一套基于MMOCR和SAM的应用程序。其特点包括:

支持端到端文本检测和识别,能够分割每个文本字符。
由扩散模型和 Gradio 驱动的引人注目的文本删除和文本修复 WebUI 演示。

安装

conda create -n ocr-sam python=3.8 -y
conda activate ocr-sam
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113

pip install -U openmim
mim install mmengine
mim install mmocr
mim install 'mmcv==2.0.0rc4'
mim install 'mmdet==3.0.0rc5'
mim install 'mmcls==1.0.0rc5'

pip install git+https://github.com/facebookresearch/segment-anything.git
pip install -r requirements.txt

pip install gradio
pip install diffusers
pip install pytorch-lightning==2.0.1.post0

下载检查点

我们以 Swin Transformer V2 作为骨干,结合多个场景文本数据集(例如 HierText、TextOCR)重新训练 DBNet++。Google Drive (1G)上的 DBNet++ 检查点。

mkdir checkpoints
mkdir checkpoints/mmocr
mkdir checkpoints/sam
mkdir checkpoints/ldm
mv db_swin_mix_pretrain.pth checkpoints/mmocr

将其余检查点下载到相关路径(如果已完成,请忽略以下内容):

# mmocr recognizer ckpt
wget -O checkpoints/mmocr/abinet_20e_st-an_mj_20221005_012617-ead8c139.pth https://download.openmmlab.com/mmocr/textrecog/abinet/abinet_20e_st-an_mj/abinet_20e_st-an_mj_20221005_012617-ead8c139.pth

# sam ckpt, more details: https://github.com/facebookresearch/segment-anything#model-checkpoints
wget -O checkpoints/sam/sam_vit_h_4b8939.pth https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth

# ldm ckpt
wget -O checkpoints/ldm/last.ckpt https://heibox.uni-heidelberg.de/f/4d9ac7ea40c64582b7c9/?dl=1

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/55891.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

在政策+市场双轮驱动下,深眸科技助力机器视觉行业走向成熟

近年来,随着人工智能发展的不断提速,机器视觉作为其重要的前沿分支,凭借着机器代替人眼来做测量和判断的能力,广泛应用于工业领域的制造生产环节,用来保证产品质量、控制生产流程、感知环境等,并迸发出强劲…

AI绘画| 迪士尼风格|可爱头像【附Midjourney提示词】

Midjourney案例分享 图片预览 迪士尼风格|可爱头像 高清原图及关键词Prompt已经放在文末网盘,需要的自取 在数字艺术的新时代,人工智能绘画已经迅速崭露头角。作为最先进的技术之一,AI绘画结合了艺术和科学,开启了一…

【工作】vant的search组件手动聚焦

背景 为了方便用户使用,第一次进来时默认输入框聚焦,但是当用户并没有输入手机号,点击按钮时,需要给一个友好提示,并且输入框重新聚集上。 过程 最开始以为search组件这个方法肯定已经实现了并且看官网文档上也有对…

redis的事务、redis持久化方案、Java操作redis数据库

五、redis的事务 开启事务: 要等左边的提交事务,右边才能拿到修改后的值 本来name不能增加,会报错,但是事务中没提交不知道错 此时提交数据: redis事务将成功的正常提交,失败的才回滚,所以不具备…

【计算机网络】11、网桥(bridge)、集线器(hub)、交换机(switch)、路由器(router)、网关(gateway)

文章目录 一、网桥(bridge)二、集线器(hub)三、交换机(switch)四、路由器(router)五、网关(gateway) 对于hub,一个包过来后,直接将包转发到其他口。 对于桥&…

边写代码边学习之卷积神经网络CNN

1. 卷积神经网络CNN 卷积神经网络(Convolutional Neural Network,CNN)是一种深度学习神经网络的架构,主要用于图像识别、图像分类和计算机视觉等任务。它是由多层神经元组成的神经网络,其中包含卷积层、池化层和全连接…

HCIP——前期综合实验

前期综合实验 一、实验拓扑二、实验要求三、实验思路四、实验步骤1、配置接口IP地址2、交换机配置划分vlan10以及vlan203、总部分部,骨干网配置OSPF分部总部骨干网 4、配置BGP建立邻居关系总部骨干网分部 5、发布用户网段6、将下一跳改为本地7、允许AS重复8、重发布…

Java中集合容器详解:简单使用与案例分析

目录 一、概览 1.1 Collection 1. Set 2. List 3. Queue 1.2 Map 二、容器中的设计模式 迭代器模式 适配器模式 三、源码分析 ArrayList 1. 概览 2. 扩容 3. 删除元素 4. 序列化 5. Fail-Fast Vector 1. 同步 2. 扩容 3. 与 ArrayList 的比较 4. 替代方案…

C#——多线程之Thread

C#——多线程之Thread 前言一、Thread是什么?二、各应用场景以及实例分析1.前台线程和后台线程:2.异步处理3.线程状态及手动销毁线程4.线程同步/等待线程完成 总结 前言 上次简单讲述了关于多线程中Task的相关应用以及场景。今天我们来看一下多线程中Th…

【LeetCode】27. 移除元素

题目大概意思是剔除nums数组中出现的所有val值。可以用快慢双指针法来做。 快的指针在前面遍历找值不为val的元素的下标,慢的负责接收值不为val的元素,并及时更新数组。 class Solution {public int removeElement(int[] nums, int val) {//快慢指针法in…

单网卡实现 双IP 双网段(内外网)同时运行

前提是内外网是同一网线连接(双网线双网卡的具体可以自己搜索下。理论上都设置静态IP后把外网跃点设置小,内网跃点设置大,关闭自动跃点设置同一个接口跃点数,在通过命令提示符添加内网网址走内网网关就可以了)。 需要使…

华为OD机试真题 JavaScript 实现【机器人活动区域】【2023Q1 200分】,附详细解题思路

目录 一、题目描述二、输入描述三、输出描述四、解题思路五、JavaScript算法源码六、效果展示1、输入2、输出 华为OD机试 2023B卷题库疯狂收录中,刷题点这里 刷的越多,抽中的概率越大,每一题都有详细的答题思路、详细的代码注释、样例测试&am…

iOS--Runloop

Runloop概述 一般来说,一个线程一次只能执行一个任务,执行完成后线程就会退出。就比如之前学OC时使用的命令行程序,执行完程序就结束了。 而runloop目的就是使线程在执行完一次代码之后不会结束程序,而是使该线程处于一种休眠的状…

【iOS】GCD深入学习

关于GCD和队列的简单介绍请看:【iOS】GCD学习 本篇主要介绍GCD中的方法。 栅栏方法:dispatch_barrier_async 我们有时候需要异步执行两组操作,而且第一组操作执行完之后,才能开始执行第二组操作,当然操作组里也可以包含一个或者…

windows下安装anaconda、pycharm、cuda、cudnn、PyTorch-GPU版本

目录 一、anaconda安装及虚拟环境创建 1.anaconda的下载 2.Anaconda的安装 3.创建虚拟环境 3.1 环境启动 3.2 切换镜像源 3.3环境创建 3.4 激活环境 3.5删除环境 二、pycharm安装 1.pycharm下载 2.pycharm的安装 三、CUDA的安装 1.GPU版本和CUDA版本、cudnn版本、显卡…

Redis 客户端有哪些?

文章目录 JedisLettuceRedisson最佳实践 - 到底用哪个? Redis 最常见的 Java 客户端有两个,Jedis 和 Lettuce,高级客户端有 Redisson,见下图(图源 Clients | Redis) Jedis Github地址:redis/j…

JavaScript创建,写入,复制,读取文件 只限IE ActiveX控件

最近接到需求,需要纯前端, 操作写入改变文件,一时间头大不已,还好此需求只需要屏幕展示,无需顾及兼容问题,找来找去找到了new ActiveXObject(“Scripting.FileSystemObject”) 强大控件 以下为自己记录的 …

贝锐蒲公英:没有公网IP,多分支企业如何高效远程访问OA系统?

贝锐蒲公英:没有公网IP,多分支企业、移动办公人员如何高效远程访问OA系统? 国内某大型美妆公司,旗下产品覆盖美容护肤品、彩妆、美容仪器、健康食品、SPA美容会所及等多类服务,致力于为客户提供高品质的产品和完善的服…

Vivado进行自定义IP封装

一. 简介 本篇文章将介绍如何使用Vivado来对上篇文章(FPGA驱动SPI屏幕)中的代码进行一个IP封装,Vivado自带的IP核应该都使用过,非常方便。 这里将其封装成IP核的目的主要是为了后续项目的调用,否则当我新建一个项目的时候,我需要将…

Mycat-Balance使用指南

MyCAT Balance是一个Java NIO的高性能负载均衡器,可以替代普通的硬件的交换机或其LVS类似的复杂机制,实现MyCAT集群的负载均衡。 MyCAT Balance的配置文件在conf目录下,frontend-conf.为前端配置,包括绑定的端口等,js…