惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 黄洪波

安装openclaw 排查项目中依赖的mybatis 拦截器 ModelAttribute 老革命遇上新问题 使用calcite构造ddl建表语句 OpenWebUI单点登录之解决动态参数问题 IDEA自带的Maven 3.9.x无法刷新http nexus私服(转) windows docker安装rocketmq之踩坑记 分布式系统设计经典论文(转载) 训练自己的yolo-v11数据集(二) 训练自己的yolo-v11数据集(一) 2024年的云原生架构需要哪些技术栈 (转) yolo v11学习,入门篇 - 黄洪波 OpenWebUI单点登录之深坑 AI工具验证 解决Win10无法进入睡眠模式(转) idea常用插件 内网离线模式下激活JRebel java导入json数据至doris 将SpringBoot打包之后的jar设为守护进程
本地使用pycharm进行yolo推理
黄洪波 · 2025-01-08 · via 博客园 - 黄洪波
from ultralytics import YOLO
# 加载预训练的 YOLOv11n 模型
model = YOLO('yolo11s.pt')
source = 'D:\\Bob\\yolo\\test\\images\\1.jpg'
# 运行推理,并附加参数
model.predict(source, save=True)
image 1/1 D:\Bob\yolo\test\images\1.jpg: 640x480 1 cat, 294.4ms
Speed: 6.0ms preprocess, 294.4ms inference, 3.0ms postprocess per image at shape (1, 3, 640, 480)
Results saved to runs\detect\predict6

yes.

但是我个人不喜欢仅仅只做物体的框选,我还希望做边缘覆盖或者边缘检测。
一番搜索,最有效的算法是canny算法,就在想这个怎么和yolo集成,又一番搜索,发现还有一个东西叫轮廓提取,额,这个我也想要。

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n-seg.pt")  # load an official model
# model = YOLO("path/to/best.pt")  # load a custom model
source = 'D:\\Bob\\yolo\\test\\images\\1.jpg'
model.predict(source, save=True)
image 1/1 D:\Bob\yolo\test\images\1.jpg: 640x480 1 cat, 251.0ms
Speed: 6.0ms preprocess, 251.0ms inference, 15.0ms postprocess per image at shape (1, 3, 640, 480)
Results saved to runs\segment\predict3
from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n-seg.pt")  # load an official model
# model = YOLO("path/to/best.pt")  # load a custom model
source = 'D:\\Bob\\yolo\\test\\images\\1.jpg'

results = model(source)
print(results)
image 1/1 D:\Bob\yolo\test\images\1.jpg: 640x480 1 cat, 277.3ms
Speed: 8.0ms preprocess, 277.3ms inference, 12.4ms postprocess per image at shape (1, 3, 640, 480)
[ultralytics.engine.results.Results object with attributes:

boxes: ultralytics.engine.results.Boxes object
keypoints: None
masks: ultralytics.engine.results.Masks object
names: {0: 'person', 1: 'bicycle', 2: 'car', 3: 'motorcycle', 4: 'airplane', 5: 'bus', 6: 'train', 7: 'truck', 8: 'boat', 9: 'traffic light', 10: 'fire hydrant', 11: 'stop sign', 12: 'parking meter', 13: 'bench', 14: 'bird', 15: 'cat', 16: 'dog', 17: 'horse', 18: 'sheep', 19: 'cow', 20: 'elephant', 21: 'bear', 22: 'zebra', 23: 'giraffe', 24: 'backpack', 25: 'umbrella', 26: 'handbag', 27: 'tie', 28: 'suitcase', 29: 'frisbee', 30: 'skis', 31: 'snowboard', 32: 'sports ball', 33: 'kite', 34: 'baseball bat', 35: 'baseball glove', 36: 'skateboard', 37: 'surfboard', 38: 'tennis racket', 39: 'bottle', 40: 'wine glass', 41: 'cup', 42: 'fork', 43: 'knife', 44: 'spoon', 45: 'bowl', 46: 'banana', 47: 'apple', 48: 'sandwich', 49: 'orange', 50: 'broccoli', 51: 'carrot', 52: 'hot dog', 53: 'pizza', 54: 'donut', 55: 'cake', 56: 'chair', 57: 'couch', 58: 'potted plant', 59: 'bed', 60: 'dining table', 61: 'toilet', 62: 'tv', 63: 'laptop', 64: 'mouse', 65: 'remote', 66: 'keyboard', 67: 'cell phone', 68: 'microwave', 69: 'oven', 70: 'toaster', 71: 'sink', 72: 'refrigerator', 73: 'book', 74: 'clock', 75: 'vase', 76: 'scissors', 77: 'teddy bear', 78: 'hair drier', 79: 'toothbrush'}
obb: None
orig_img: array([[[190, 195, 194],
        [188, 193, 192],
        [184, 189, 188],
        ...,
        [185, 185, 185],
        [176, 176, 176],
        [169, 169, 169]],

       [[190, 195, 194],
        [189, 194, 193],
        [189, 194, 193],
        ...,
        [202, 202, 202],
        [193, 193, 193],
        [184, 184, 184]],

       [[196, 201, 200],
        [195, 200, 199],
        [195, 200, 199],
        ...,
        [206, 206, 206],
        [201, 201, 201],
        [195, 195, 195]],

       ...,

       [[228, 231, 229],
        [233, 236, 234],
        [237, 240, 238],
        ...,
        [245, 248, 239],
        [245, 247, 241],
        [246, 249, 240]],

       [[231, 234, 232],
        [233, 236, 234],
        [236, 239, 237],
        ...,
        [247, 251, 240],
        [241, 244, 235],
        [238, 242, 231]],

       [[231, 234, 232],
        [229, 232, 230],
        [227, 230, 228],
        ...,
        [239, 243, 232],
        [236, 240, 229],
        [237, 241, 230]]], dtype=uint8)
orig_shape: (1440, 1078)
path: 'D:\\Bob\\yolo\\test\\images\\1.jpg'
probs: None
save_dir: 'runs\\segment\\predict4'
speed: {'preprocess': 7.999897003173828, 'inference': 277.3125171661377, 'postprocess': 12.35508918762207}]

Process finished with exit code 0