我在记 2023-09-26 16:05 采纳率: 0%
浏览 11

关于#YOLOv#的问题,如何解决?无锚框

YOLOV8最新版本detect图片,但是结果上没有锚框,请教一下大家。使用之前版本的v8没有这种问题的,现在直接git下来最新的就这样子了

我使用的代码如下

from ultralytics import YOLO

model = YOLO("yolov8s.pt")  # load a pretrained model (recommended for training)

# Use the model
model.predict(source='https://media.roboflow.com/notebooks/examples/dog.jpeg') 

结果只有这样子

img

img

我已经开启了detect里面的大部分设置了,能够得到label,执行后终端也能显示识别出了几个东西,但是就是不显示

# Prediction settings --------------------------------------------------------------------------------------------------
source:  # (str, optional) source directory for images or videos
show: True  # (bool) show results if possible
save_txt: True  # (bool) save results as .txt file
save_conf: True  # (bool) save results with confidence scores
save_crop: True  # (bool) save cropped images with results
show_labels: True  # (bool) show object labels in plots
show_conf: True  # (bool) show object confidence scores in plots
vid_stride: 1  # (int) video frame-rate stride
stream_buffer: False  # (bool) buffer all streaming frames (True) or return the most recent frame (False)
line_width:   # (int, optional) line width of the bounding boxes, auto if missing
visualize: True  # (bool) visualize model features
augment: False  # (bool) apply image augmentation to prediction sources
agnostic_nms: False  # (bool) class-agnostic NMS
classes:  # (int | list[int], optional) filter results by class, i.e. classes=0, or classes=[0,2,3]
retina_masks: False  # (bool) use high-resolution segmentation masks
boxes: True  # (bool) Show boxes in segmentation predictions

image 1/1 /content/drive/MyDrive/dog.jpeg: 640x384 1 person, 1 car, 1 dog, 1 handbag, 31409.6ms
Speed: 6.2ms preprocess, 31409.6ms inference, 1.0ms postprocess per image at shape (1, 3, 640, 384)
Results saved to /content/drive/My Drive/ultralytics/runs/detect/predict3
1 label saved to /content/drive/My Drive/ultralytics/runs/detect/predict3/labels

  • 写回答

1条回答 默认 最新

  • 钱多多先森 博客专家认证 2023-09-27 16:59
    关注

    在yolov8中,对代码进行了封装,其中model.predict里面是可以设定参数的,你知道不,下面是我预测时候,设定的内容。

    model.predict(source=img_dir, show=False, save=False, imgsz=640, save_txt=False, conf=0.01, iou=0.3)

    我注意到这一行打印的内容里面:
    image 1/1 /content/drive/MyDrive/dog.jpeg: 640x384 1 person, 1 car, 1 dog, 1 handbag, 31409.6ms
    后面这个1 person, 1 car, 1 dog, 1 handbag,就是简略的预测结果,说明是预测的有的,只是没有绘制到图像上。你看看官方的文档,或者参考我上面的内容,save=True, 看看输出结果,结果默认会存储到runs里面,最新创建的文件夹里

    评论

报告相同问题?

问题事件

  • 创建了问题 9月26日

悬赏问题

  • ¥15 Mac版Fiddler Everywhere4.0.1提示强制更新
  • ¥15 android 集成sentry上报时报错。
  • ¥50 win10链接MySQL
  • ¥35 跳过我的世界插件ip验证
  • ¥15 抖音看过的视频,缓存在哪个文件
  • ¥15 自定义损失函数报输入参数的数目不足
  • ¥15 如果我想学习C大家有是的的资料吗
  • ¥15 根据文件名称对文件进行排序
  • ¥15 deploylinux的ubuntu系统无法成功安装使用MySQL❓
  • ¥15 有人会用py或者r画这种图吗