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.2.1.tar.gz (5.4 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.2.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

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

Hashes for meta_om-0.2.1.tar.gz
Algorithm Hash digest
SHA256 97668b0cbf90aa025f759036ca5dd92010f076005320d052a1cb6e48e662ba37
MD5 6a0f03cb3b4d41a91d759021a5c51ee4
BLAKE2b-256 62b43859051e9667a8fd8cb44626a6b87b29c279d56251f2d0dabee1eb61ed77

See more details on using hashes here.

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

Hashes for meta_om-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67175be5ed4138ce22c6d6cf26aa771146a8dd9a4d10218be61accf79383c4ff
MD5 90079beaea496c83d67cc8fc1d33ba05
BLAKE2b-256 32d5512f3c55d1c96e1da3d5565d6325e576a9a94e346a4329ef1b1a99fc998e

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