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.1.tar.gz
(5.3 kB
view details)
Built Distribution
meta_rt-0.1.1-py3-none-any.whl
(10.7 kB
view details)
File details
Details for the file meta-rt-0.1.1.tar.gz
.
File metadata
- Download URL: meta-rt-0.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db0b782fe6fb70fa280b52c54d88dcc99568e2213160f3b56d54030b63f3fd78 |
|
MD5 | 5839820258ef950f4fe6c2d3fe52afa4 |
|
BLAKE2b-256 | 2a40aea361a36e34ca7015b4db7bb83aea909b6ee1c06487fda865173bbf4bbf |
File details
Details for the file meta_rt-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: meta_rt-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef8abeccd25e8e233e0f84d18ce9b7ffce5eae7ed974394c743b93ddfa23fa73 |
|
MD5 | 653f2cd8a6be74eda6497cdc0e1b8db4 |
|
BLAKE2b-256 | 18fde88ec5202c7bdd563f7b897dcc0848dddb131021e94578effb4de1ac234b |