Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meta_om-0.1.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

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

Hashes for meta_om-0.1.1.tar.gz
Algorithm Hash digest
SHA256 01da9449a9ea27fb0b1025f3cb9a05d298e1e45ed84580b2a8ffbd03564adfc8
MD5 a19623a441577177313f992726456a1b
BLAKE2b-256 5b93d1d1719c9c6cc44f5f38f36a74374bb5a5d70fbacc63a26db80d69892740

See more details on using hashes here.

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

Hashes for meta_om-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48ef01d94da98463d80c94ef230599684f2a241d4e38533e3e8597737289c9c0
MD5 c43b1551144914ff6f00217ba1cc6f6a
BLAKE2b-256 2121160273143f61a45dcb3238506b514343b8d5bbf5c8e5984c1e868a4e38e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page