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.3.tar.gz
(5.2 kB
view details)
Built Distribution
meta_rt-0.1.3-py3-none-any.whl
(10.7 kB
view details)
File details
Details for the file meta-rt-0.1.3.tar.gz
.
File metadata
- Download URL: meta-rt-0.1.3.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 190de326cb143e4cb59659a0b516523898c6f48f8ff823269afeeae1ff2e9ff2 |
|
MD5 | a0dde888e63c304c257daed07b9f70ed |
|
BLAKE2b-256 | 2514b05065e34e75836d635923debeeaea52a9848ec93cae993d508fea6bc866 |
File details
Details for the file meta_rt-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: meta_rt-0.1.3-py3-none-any.whl
- Upload date:
- Size: 10.7 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fb664c2d966837f207a3c1d091f645e23a5f0a1b6e2fb0f1a4ed1b2750fc7f2 |
|
MD5 | c922de7dc2393d24f94b3dc0c52f8dd5 |
|
BLAKE2b-256 | 2d82960392b2b37c87544c9c8295dc6f125bf5887c41bb876393f58850543562 |