Comments (2)
Example for segmentation using Lite.AI.ToolKit🚀🚀🌟:
#include "lite/lite.h"
static void test_default()
{
std::string onnx_path = "../../../hub/onnx/cv/deeplabv3_resnet101_coco.onnx";
std::string test_img_path = "../../../examples/lite/resources/test_lite_deeplabv3_resnet101.png";
std::string save_img_path = "../../../logs/test_lite_deeplabv3_resnet101.jpg";
lite::cv::segmentation::DeepLabV3ResNet101 *deeplabv3_resnet101 =
new lite::cv::segmentation::DeepLabV3ResNet101(onnx_path, 16); // 16 threads
lite::cv::types::SegmentContent content;
cv::Mat img_bgr = cv::imread(test_img_path);
deeplabv3_resnet101->detect(img_bgr, content);
if (content.flag)
{
cv::Mat out_img;
cv::addWeighted(img_bgr, 0.2, content.color_mat, 0.8, 0., out_img);
cv::imwrite(save_img_path, out_img);
if (!content.names_map.empty())
{
for (auto it = content.names_map.begin(); it != content.names_map.end(); ++it)
{
std::cout << "Default Version Detected Label: "
<< it->first << " Name: " << it->second << std::endl;
}
}
}
delete deeplabv3_resnet101;
}
Example for objection using Lite.AI.ToolKit🚀🚀🌟:
#include "lite/lite.h"
static void test_default()
{
std::string onnx_path = "../../../hub/onnx/cv/yolov5s.onnx";
std::string test_img_path = "../../../examples/lite/resources/test_lite_yolov5_1.jpg";
std::string save_img_path = "../../../logs/test_lite_yolov5_1.jpg";
auto *yolov5 = new lite::cv::detection::YoloV5(onnx_path);
std::vector<lite::cv::types::Boxf> detected_boxes;
cv::Mat img_bgr = cv::imread(test_img_path);
yolov5->detect(img_bgr, detected_boxes);
lite::cv::utils::draw_boxes_inplace(img_bgr, detected_boxes);
cv::imwrite(save_img_path, img_bgr);
delete yolov5;
}
from lite.ai.toolkit.
it seems hard to re-implementation the whole detectron2 with C++, it has a lot of models, i am not sure whether all the operators detectron2 used are supported by ONNX or any other inference engine. However, you can try the segmentation and detection modules in this repo, such as lite::cv::detection::YOLOX
or lite::cv::segmentation::DeepLabV3ResNet101
. Further more, if there is a model you are interested in and want to be supported by Lite.AI.ToolKit🚀🚀🌟, you can fork this repo and modify TODOLIST.md, then submit a PR~ I will review this PR and try to support this model in the future, but I don’t make sure this can be done.
from lite.ai.toolkit.
Related Issues (20)
- How to obtain KPS from using Retinaface implementation HOT 2
- MacOS 下开启 Metal 会崩溃 HOT 4
- MacOS 下开启 Metal 应该使用什么方案 HOT 3
- 求兼容macOS m1 HOT 4
- RESOURCES HOT 1
- Compile on M1 Chip HOT 5
- Example4: Face Recognition using ArcFace. 怎么加速推理时间? HOT 1
- rvm模型用mnn推理结果有误啊 HOT 1
- batch glint inference HOT 2
- MacOS下启用Metal加速后,效果较差,需要如何改进呢? HOT 1
- 加入mrnet的mnn部署 HOT 1
- Docker image invalid tar header HOT 1
- 你好,有OCR的模型部署吗? HOT 2
- [BUG][Tracker] can not found any test model in examples/hub directory HOT 1
- [BUG]libopencv_imgproc.so.409: cannot open shared object file: No such file or directory HOT 4
- Windows 运行 RVM 使用 rvm_mobilenetv3_fp16.onnx 崩溃
- 请问可以支持DNN吗?
- Windows MNN 初始化 RobustVideoMatting 失败
- 如何配置环境调试代码,进行学习呢 HOT 1
- mnn_rvm.cpp 怎么使用动态分辨率的输入 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lite.ai.toolkit.