yolo进行视频检测结果没有生成

你可能用了这套代码:

from ultralytics import YOLO

# Load a pretrained YOLOv8n model
model = YOLO('./best.pt')

# Define path to video file
source = r".\WeChat_20240515193007.mp4"

# Run inference on the source
results = model(source, stream=True)  # generator of Results objects

这套代码它把结果放到了results中 但没有保存。

正确代码:


from ultralytics import YOLO

# Load a pretrained YOLOv8n model
model = YOLO(r"./best.pt")

# Run inference on 'bus.jpg' with arguments
model.predict(r"./p1_rgb.mp4", save=True, imgsz=320, conf=0.5)

相关推荐

  1. yolo进行视频检测结果没有生成

    2024-05-15 21:16:04       31 阅读
  2. YOLOv8检测图片和视频

    2024-05-15 21:16:04       35 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-15 21:16:04       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-15 21:16:04       100 阅读
  3. 在Django里面运行非项目文件

    2024-05-15 21:16:04       82 阅读
  4. Python语言-面向对象

    2024-05-15 21:16:04       91 阅读

热门阅读

  1. Linux函数

    2024-05-15 21:16:04       29 阅读
  2. nvr国标sip端口信息异常的处理

    2024-05-15 21:16:04       33 阅读
  3. SpringBoot+Mock Mvc测试web接口增删改查、导入导出

    2024-05-15 21:16:04       31 阅读
  4. 微信小程序更新日志

    2024-05-15 21:16:04       32 阅读
  5. 设计模式之——单例模式

    2024-05-15 21:16:04       34 阅读
  6. android设计模式-单例模式

    2024-05-15 21:16:04       38 阅读
  7. 【设计模式】单例模式-学习记录

    2024-05-15 21:16:04       34 阅读
  8. redis中的大key问题

    2024-05-15 21:16:04       28 阅读
  9. Android Studio实现简易音乐播放器(期末作业)

    2024-05-15 21:16:04       33 阅读
  10. Android security知识点总结

    2024-05-15 21:16:04       26 阅读