소스 정보
- 저장소
- MIUAV/vibe-coding-ros2
- 최근 소스 활동
- 2026년 4월 3일 16:37
- 감지된 SKILL.md 언어
- 중국어
- 스타
- 26
- 포크
- 2
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/MIUAV/vibe-coding-ros2 --skill openvino-deployment명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | openvino-deployment |
| description | OpenVINO 部署技能 - 模型优化、IR 转换、GPU/CPU/VPU 推理、ROS2 部署 |
| argument-hint | OpenVINO OR IE OR IR OR Intel OR openvino deployment |
| user-invocable | true |
Intel CPU/GPU/VPU 推理加速
当需要以下帮助时使用此技能:
from openvino.tools import mo
from openvino.runtime import Core, Layout
import numpy as np
class OpenVINOConverter:
def __init__(self):
self.core = Core()
def convert_model(self, model_path, input_shape, output_dir):
"""模型转换"""
# ONNX 转 IR
model = mo.convert_model(
model_path,
input_shape=input_shape,
layout=Layout('NCHW') if 'nhwc' not in input_shape else Layout('NHWC'),
compress_to_fp16=True
)
# 保存
serialize(model, output_dir + '/model.xml')
return model
def compile_model(self, model_path, device='CPU'):
"""编译模型"""
model = self.core.read_model(model_path)
# 优化配置
config = {
'PERFORMANCE_HINT': 'LATENCY',
'NUM_STREAMS': '1',
'INFERENCE_PRECISION_HINT': 'f16'
}
compiled = self.core.compile_model(model, device, config)
return compiled
def optimize_model(self, model):
"""模型优化"""
# 使用 OVC 优化
# 量化、剪枝等
pass
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from openvino.runtime import Core, AsyncInferQueue
import numpy as np
import cv2
class OpenVINONode(Node):
def __init__(self):
super().__init__('openvino_node')
self.bridge = CvBridge()
# 初始化 OpenVINO
self.core = Core()
self.model = self.core.read_model('/path/to/model.xml')
self.compiled_model = self.core.compile_model(self.model, 'CPU')
self.infer_request = self.compiled_model.create_infer_request()
# 异步队列
self.async_queue = AsyncInferQueue(self.compiled_model, 4)
# 订阅
self.image_sub = self.create_subscription(
Image, '/image_raw', self.callback, 10)
self.pub = self.create_publisher(Image, , )
.get_logger().info()
():
cv_image = .bridge.imgmsg_to_cv2(msg, desired_encoding=)
input_data = .preprocess(cv_image)
input_tensor = .compiled_model.()
.infer_request.set_input_tensor(input_tensor.data, input_data)
.infer_request.start_async()
.infer_request.wait()
output = .infer_request.get_output_tensor().data
results = .postprocess(output)
output_image = .draw_results(cv_image, results)
output_msg = .bridge.cv2_to_imgmsg(output_image, )
.pub.publish(output_msg)
():
img = cv2.resize(image, (, ))
img = img.transpose(, , )
img = img.astype(np.float32) /
img
():
outputs
():
det results:
x1, y1, x2, y2, score, cls = det
cv2.rectangle(image, ((x1), (y1)), ((x2), (y2)), (, , ), )
image
class MultiDeviceInference:
def __init__(self):
self.core = Core()
def load_multi_device(self, model_path):
"""多设备加载"""
# GPU + CPU 异构
device_affinity = {'image': 'GPU.0', 'detection': 'CPU'}
devices = {}
for name, device in device_affinity.items():
model = self.core.read_model(model_path)
devices[name] = self.core.compile_model(model, device)
return devices
def infer(self, devices, inputs):
"""异构推理"""
# 异步并行
results = {}
for name, device in devices.items():
request = device.create_infer_request()
request.start_async()
results[name] = request
request.wait()
return results