首页 > 解决方案 > 计算并显示找到的对象的百分比

问题描述

下面是我在 google Colab 上使用的代码,该代码给了我检测到的每种产品的总数,我可以添加什么来显示百分比而不是总数?将不胜感激任何帮助,谢谢

import torch

# Model
model = torch.hub.load('ultralytics/yolov5', 'custom', 
path='/content/yolov5/runs/train/exp/weights/best.pt')  # default

# Image
imgs = '/content/20210921_161048_4.jpg'

# Inference
results = model(imgs)
results.print()  

在此处输入图像描述

标签: objectpercentagedetection

解决方案


推荐阅读