mirror of
https://github.com/sipeed/MaixCDK.git
synced 2026-09-10 21:59:54 -05:00
9.0 KiB
9.0 KiB
title, id
| title | id |
|---|---|
| MaixCDK | home_page |
<script src="/static/css/tailwind.css"></script>
<style>
h2 {
font-size: 1.6em;
font-weight: 600;
font-weight: bold;
}
#page_wrapper
{
background: #f2f4f3;
}
.dark #page_wrapper
{
background: #1b1b1b;
}
.md_page #page_content
{
padding: 1em;
}
.md_page #page_content > div
{
width: 100%;
max-width: 100%;
text-align: left;
}
h1 {
font-size: 3em;
font-weight: 600;
margin-top: 0.67em;
margin-bottom: 0.67em;
}
#page_content h2 {
font-size: 1.6em;
font-weight: 600;
margin-top: 1em;
margin-bottom: 0.67em;
font-weight: bold;
text-align: center;
margin-top: 3em;
margin-bottom: 1.5em;
}
#page_content h3 {
font-size: 1.5em;
font-weight: 400;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
#tags > p {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 1em;
}
#tags > p a {
margin: 0.2em 0.2em;
}
#feature video, #feature img {
height: 15em;
}
.feature_item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
margin: 1em;
border: 1em solid white;
background: white;
border-radius: 0.5em;
overflow: hidden;
max-width: 20em;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.dark .feature_item {
border: 1em solid #2d2d2d;
background: #2d2d2d;
}
.feature_item .feature {
font-size: 1.2em;
font-weight: 600;
}
.feature_item .description {
font-size: 0.8em;
font-weight: 400;
}
.feature_item video, .feature_item img {
width: 100%;
object-fit: cover;
}
.feature_item .img_video {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.feature_item > div {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
.feature_item p {
padding: 0.5em;
}
#page_content li {
margin: 0.5em;
list-style-type: disc;
}
.white_border {
border: 1em solid white;
}
.dark .white_border {
border: 1em solid #2d2d2d;
}
.code-toolbar pre {
margin: 0;
}
.code_wrapper {
overflow: auto;
}
@media screen and (min-width: 1280px) {
.md_page #page_content > div
{
width: 1440px;
max-width: 1440px;
}
}
@media screen and (max-width: 768px) {
.code_wrapper {
font-size: 0.6em;
}
}
</style>
English | 中文
If you like MaixCDK or MaixPy, please give a star ⭐️ to the MaixPy and MaixCDK open source project to encourage us to develop more features.
Simple API Design, AI Image Recognition within 20 Lines of Code
#include "maix_nn.hpp"
#include "maix_camera.hpp"
#include "maix_display.hpp"
int main()
{
nn::Classifier classifier("/root/models/mobilenetv2.mud");
image::Size input_size = classifier.input_size();
camera::Camera cam = camera::Camera(input_size.width(), input_size.height(), classifier.input_format());
display::Display disp = display::Display();
char msg[64];
while(!app::need_exit())
{
image::Image *img = cam.read();
auto *result = classifier.classify(*img);
int max_idx = result->at(0).first;
float max_score = result->at(0).second;
snprintf(msg, sizeof(msg), "%5.2f: %s", max_score, classifier.labels[max_idx].c_str());
img->draw_string(10, 10, msg, image::COLOR_RED);
disp.show(*img);
delete result;
delete img;
}
return 0;
}
Same simple Python API binding
from maix import camera, display, image, nn
classifier = nn.Classifier(model="/root/models/mobilenetv2.mud")
cam = camera.Camera(classifier.input_width(), classifier.input_height(), classifier.input_format())
dis = display.Display()
while 1:
img = cam.read()
res = classifier.classify(img)
max_idx, max_prob = res[0]
msg = f"{max_prob:5.2f}: {classifier.labels[max_idx]}"
img.draw_string(10, 10, msg, image.COLOR_RED)
dis.show(img)
Variety of built-in functions
The functionality of MaixCDK is kept in sync with MaixPy, and the MaixPy documentation is also applicable to MaixCDK.
Add Python binding in one second
Just add comments, then you can use this API in MaixPy!
Python demo code:
from maix import uart
devices = uart.list_devices()
print(devices)
MaixCDK implemention in maix_uart.hpp:
namespace maix::uart {
/**
* List all UART devices can be directly used.
* @return All device path, list type, element is string type
* @maixpy maix.uart.list_devices
*/
std::vector<std::string> list_devices();
}
Online AI Training Platform MaixHub
No need for AI expertise or expensive training equipment, train models with one click, deploy to MaixCAM with one click.
Maix Ecosystem
Community
| Community | Address |
|---|---|
| MaixCDK Documentation | MaixCDK Documentation |
| MaixPy Documentation | MaixPy Documentation |
| App Store | maixhub.com/app |
| Project Sharing | maixhub.com/share |
| Bilibili | Search for MaixCAM or MaixPy on Bilibili |
| Discussion | maixhub.com/discussion |
| MaixCDK issues | github.com/sipeed/MaixPy/issues |
| Telegram | t.me/maixpy |
| QQ Group | 862340358 |
