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.1.1.tar.gz
(5.3 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.1.1.tar.gz.
File metadata
- Download URL: meta_om-0.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01da9449a9ea27fb0b1025f3cb9a05d298e1e45ed84580b2a8ffbd03564adfc8
|
|
| MD5 |
a19623a441577177313f992726456a1b
|
|
| BLAKE2b-256 |
5b93d1d1719c9c6cc44f5f38f36a74374bb5a5d70fbacc63a26db80d69892740
|
File details
Details for the file meta_om-0.1.1-py3-none-any.whl.
File metadata
- Download URL: meta_om-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.8 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 |
48ef01d94da98463d80c94ef230599684f2a241d4e38533e3e8597737289c9c0
|
|
| MD5 |
c43b1551144914ff6f00217ba1cc6f6a
|
|
| BLAKE2b-256 |
2121160273143f61a45dcb3238506b514343b8d5bbf5c8e5984c1e868a4e38e8
|