山高水长
首页
  • 分类
  • 标签
  • 归档
友情链接
GitHub (opens new window)

山高水长

首页
  • 分类
  • 标签
  • 归档
友情链接
GitHub (opens new window)
  • mmdetection 结果可视化
  • mmdetection 训练出现 nan
  • mmdetection绘制PR曲线
  • 获取最高map的epoch
  • mmdetection报错汇总
  • mmdetection
Shanya
2022-05-12

mmdetection 结果可视化

将此代码放入mmdetection的根目录下执行,替换相应的路径即可

import os

from mmdet.apis import init_detector, inference_detector

config_file = '/home/lgh/Desktop/ours/config.py'
checkpoint_file = '/home/lgh/Desktop/ours/best.pth'
device = 'cuda:0'
model = init_detector(config_file, checkpoint_file, device=device)
imgPath = '/home/lgh/code/mmdetection/data/NEU_DET/coco/train2017'
imgList = os.listdir(imgPath)
outPath = '/home/lgh/code/mmdetection/data/NEU_DET/coco/out'
if not os.path.exists(outPath):
    os.mkdir(outPath)
for img in imgList:
    image = os.path.join(imgPath,img)
    model.show_result(
        image,
        inference_detector(model, image),
        score_thr=0.3,
        show=False,
        wait_time=0,
        win_name="result",
        bbox_color=(255, 0, 0),
        text_color=(200, 200, 200),
        mask_color=None,
        out_file=os.path.join(outPath, img))

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
编辑 (opens new window)
#mmdetection
上次更新: 2022/09/30, 04:53:04
mmdetection 训练出现 nan

mmdetection 训练出现 nan→

最近更新
01
FCOS
09-30
02
Python执行终端命令
09-13
03
Android Compose 权限请求
08-12
更多文章>
Theme by Vdoing | Copyright © 2020-2022 Shanya | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式