Meta OM Toolkit
Project description
metaom
metaom部署通用框架
1、安装最新版 meta-cv
pip install meta-cv
2、安装最新版 meta-om
pip install meta-om
3、目标检测示例(参考detection_demo.py代码)
import cv2, platform
import metaom as m
Detection = m.Detection
y = Detection(
model_path='models/yolov8m-seg_quantized_model.om',
input_width=640,
input_height=480,
use_preprocess=True,
pad=True,
confidence_thresh=0.5,
nms_thresh=0.3,
class_names=classnames,
device_id=0)
batch_size = 1
img = cv2.imread('models/bus.jpg')
img_list = [img[:, :, ::-1]] * batch_size if batch_size > 1 else img[:, :, ::-1]
_dets, _scores, _labels = y.predict(img_list)
# 显示
y.show(img, _dets[-1], _scores[-1], _labels[-1])
cv2.imwrite("models/bus.png", img)
4、实例分割示例(参考segment_demo.py代码)
import cv2, platform
import metaom as m
Segment = m.Segment
y = Segment(
model_path='models/yolov8m-seg_quantized_model.om',
input_width=640,
input_height=480,
use_preprocess=True,
pad=True,
confidence_thresh=0.5,
nms_thresh=0.3,
class_names=classnames,
device_id=0)
batch_size = 1
img = cv2.imread('models/bus.jpg')
img_list = [img[:, :, ::-1]] * batch_size if batch_size > 1 else img[:, :, ::-1]
_dets, _scores, _labels = y.predict(img_list)
# 显示
y.show(img, _dets[-1], _scores[-1], _labels[-1])
cv2.imwrite("models/bus.png", img)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
meta_om-0.2.1.tar.gz
(5.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meta_om-0.2.1.tar.gz.
File metadata
- Download URL: meta_om-0.2.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97668b0cbf90aa025f759036ca5dd92010f076005320d052a1cb6e48e662ba37
|
|
| MD5 |
6a0f03cb3b4d41a91d759021a5c51ee4
|
|
| BLAKE2b-256 |
62b43859051e9667a8fd8cb44626a6b87b29c279d56251f2d0dabee1eb61ed77
|
File details
Details for the file meta_om-0.2.1-py3-none-any.whl.
File metadata
- Download URL: meta_om-0.2.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67175be5ed4138ce22c6d6cf26aa771146a8dd9a4d10218be61accf79383c4ff
|
|
| MD5 |
90079beaea496c83d67cc8fc1d33ba05
|
|
| BLAKE2b-256 |
32d5512f3c55d1c96e1da3d5565d6325e576a9a94e346a4329ef1b1a99fc998e
|