The code below can show and save image with result.import mmcv
import cv2
from mmcv.runner import load_checkpoint
from mmdet.models import build_detector
from mmdet.apis import init_detector, inference_detector, show_result_pyplot
import matplotlib.pyplot as plt
config_file ='/home/en_ro/mmdata/mmdetection/configs/balloon/faster_rcnn_r50_fpn_1x_voc_cat0602.py'
checkpoint_file ='/home/en_ro/mmdetection/work_dirs/faster_rcnn_r50_fpn_1x_voc_cat0602/epoch_100.pth'
model = init_detector(config_file,checkpoint_file)
img ='017-01_0034_o_S017-1_0035.JPG'
result = inference_detector(model,img)# 这句用来显示的,但是Linux弹出不来的情况下, 就看不到结果,只能保存了看
show_result_pyplot(model, img, result, score_thr=0.6)# show the image with result# 最主要就是下面这句
model.show_result(img, result, out_file='0617.jpg')# save image with result
Spring 1、不同版本的 Spring Framework 有哪些主要功能? 2、什么是 Spring Framework? Spring 是一个开源应用框架,旨在降低应用程序开发的复杂度。它是轻量级、松散耦合的。 它具有分层体系结构,允许用户选择组件,…