在显示图片时由于是在终端输入代码因此无法显示图片,因此写了如下代码将测试图片保存下来进行查看,但不知在如下代码加入什么才可以仅显示得分在0.5以上的检测框

在显示图片时由于是在终端输入代码因此无法显示图片,因此写了如下代码将测试图片保存下来进行查看,但不知在如下代码加入什么才可以仅显示得分在0.5以上的检测框

基于最新版ChatGPT4的回答,望采纳!!!有其他问题也可以询问我哦、”(最新版更智能,功能更加强大)
from mmdet.apis import init_detector, inference_detector
config_file = 'configs/swin/faster_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_1x_coco.py'
checkpoint_file = 'work_dirs11/faster_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_1x_coco/epoch_6.pth'
device = 'cuda:0'
# init a detector
model = init_detector(config_file, checkpoint_file, device=device)
# inference the demo image
img = 'testfiles/img1.jpg'
result = inference_detector(model, img)
# show and save the result
model.show_result(img, result, score_thr=0.5, out_file="demo/demo_result111.jpg")