Skip to main content

Meta TR Toolkit

Project description

metart

metart部署通用框架

1、安装最新版 meta-cv

pip install meta-cv

2、安装最新版 meta-rt

pip install meta-rt

3、目标检测示例(参考detection_demo.py代码)

import platform, cv2
import metart as m

Detection = m.Detection

y = Detection(model_path='models/yolov8m.rt',
              input_width=640,
              input_height=480,
              use_preprocess=True,
              pad=True,
              normal=True,
              swap=(2, 0, 1),
              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 platform, cv2
import metart as m

Segment = m.Segment

y = Segment(model_path='models/yolov8m-seg.rt',
            input_width=640,
            input_height=480,
            use_preprocess=True,
            pad=True,
            normal=True,
            swap=(2, 0, 1),
            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-rt-0.1.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

meta_rt-0.1.4-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file meta-rt-0.1.4.tar.gz.

File metadata

  • Download URL: meta-rt-0.1.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.15 tqdm/4.64.0 importlib-metadata/4.2.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13

File hashes

Hashes for meta-rt-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b28b4866fab21b3311ec507c41c9e3e3bb64373001314390df1b088956e73c0e
MD5 9a218f7fa1103803602865adee24c11d
BLAKE2b-256 7ed05a6fee588fb17b252c8c7dcedb1ba9644154fa3008db554ec47fb17ae1bf

See more details on using hashes here.

File details

Details for the file meta_rt-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: meta_rt-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.15 tqdm/4.64.0 importlib-metadata/4.2.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.13

File hashes

Hashes for meta_rt-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 529add24c2b96b94e71233ce8ee0cc4739abb0662607268b3d4d65e8115d5421
MD5 ba388a285ee889ba6e4e547518b2d977
BLAKE2b-256 367be46252453174c326c8d60adbc92467bf6514500f66e51ed52fcb725485ed

See more details on using hashes here.

Supported by

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