From 722acf2043dcb8eee3fd99a661b17d2ba088d25d Mon Sep 17 00:00:00 2001 From: Neucrack Date: Thu, 16 May 2024 19:22:37 +0800 Subject: [PATCH] update doc --- maixpy/api/api.json | 1566 +++++++++++++++-- maixpy/api/index.html | 11 + maixpy/api/maix/app.html | 3 + maixpy/api/maix/audio.html | 797 +++++++++ maixpy/api/maix/camera.html | 87 + maixpy/api/maix/comm.html | 3 + maixpy/api/maix/display.html | 3 + maixpy/api/maix/err.html | 3 + maixpy/api/maix/example.html | 3 + maixpy/api/maix/fs.html | 3 + maixpy/api/maix/i18n.html | 3 + maixpy/api/maix/image.html | 48 +- maixpy/api/maix/network.html | 3 + maixpy/api/maix/network/wifi.html | 3 + maixpy/api/maix/nn.html | 1111 +++++++++++- maixpy/api/maix/nn/F.html | 7 +- maixpy/api/maix/peripheral.html | 11 +- maixpy/api/maix/peripheral/adc.html | 7 +- maixpy/api/maix/peripheral/gpio.html | 3 + maixpy/api/maix/peripheral/i2c.html | 3 + maixpy/api/maix/peripheral/key.html | 3 + maixpy/api/maix/peripheral/pinmap.html | 394 +++++ maixpy/api/maix/peripheral/pwm.html | 7 +- maixpy/api/maix/peripheral/spi.html | 3 + maixpy/api/maix/peripheral/timer.html | 3 + maixpy/api/maix/peripheral/uart.html | 3 + maixpy/api/maix/peripheral/wdt.html | 7 +- maixpy/api/maix/protocol.html | 3 + maixpy/api/maix/rtmp.html | 529 ++++++ maixpy/api/maix/rtsp.html | 7 +- maixpy/api/maix/sys.html | 3 + maixpy/api/maix/tensor.html | 34 + maixpy/api/maix/thread.html | 3 + maixpy/api/maix/time.html | 3 + maixpy/api/maix/touchscreen.html | 3 + maixpy/api/maix/util.html | 3 + maixpy/api/maix/video.html | 57 +- maixpy/api/sidebar.yaml | 9 + maixpy/doc/assets/face_detection.jpg | Bin 0 -> 23505 bytes maixpy/doc/assets/maixvision_browser.jpg | Bin 0 -> 65722 bytes maixpy/doc/assets/maixvision_browser2.jpg | Bin 0 -> 5712 bytes maixpy/doc/en/audio/recognize.html | 41 +- maixpy/doc/en/basic/app.html | 41 +- maixpy/doc/en/basic/app_usage.html | 41 +- maixpy/doc/en/basic/linux_basic.html | 41 +- maixpy/doc/en/basic/maixpy_upgrade.html | 41 +- maixpy/doc/en/basic/maixvision.html | 130 +- maixpy/doc/en/basic/os.html | 41 +- maixpy/doc/en/basic/python.html | 41 +- maixpy/doc/en/basic/python_pkgs.html | 41 +- maixpy/doc/en/faq.html | 41 +- maixpy/doc/en/index.html | 41 +- maixpy/doc/en/modules/acc.html | 41 +- maixpy/doc/en/modules/thermal_cam.html | 45 +- maixpy/doc/en/modules/tof.html | 41 +- maixpy/doc/en/no_translate.html | 41 +- maixpy/doc/en/peripheral/gpio.html | 85 +- maixpy/doc/en/peripheral/i2c.html | 88 +- maixpy/doc/en/peripheral/pwm.html | 88 +- maixpy/doc/en/peripheral/spi.html | 54 +- maixpy/doc/en/peripheral/uart.html | 104 +- maixpy/doc/en/peripheral/wdt.html | 67 +- maixpy/doc/en/pro/compile_os.html | 41 +- maixpy/doc/en/projects/index.html | 357 ++++ .../doc/en/projects/line_tracking_robot.html | 420 +++++ maixpy/doc/en/sidebar.yaml | 226 +-- maixpy/doc/en/source_code/add_c_module.html | 41 +- maixpy/doc/en/source_code/build.html | 63 +- maixpy/doc/en/source_code/contribute.html | 45 +- maixpy/doc/en/source_code/faq.html | 47 +- maixpy/doc/en/source_code/maixcdk.html | 41 +- maixpy/doc/en/video/jpeg_streaming.html | 41 +- maixpy/doc/en/vision/ai.html | 41 +- maixpy/doc/en/vision/apriltag.html | 43 +- maixpy/doc/en/vision/body_key_points.html | 43 +- maixpy/doc/en/vision/camera.html | 41 +- maixpy/doc/en/vision/classify.html | 41 +- maixpy/doc/en/vision/custmize_model.html | 41 +- maixpy/doc/en/vision/display.html | 41 +- maixpy/doc/en/vision/face_detection.html | 374 ++++ maixpy/doc/en/vision/face_recognition.html | 45 +- maixpy/doc/en/vision/find_blobs.html | 47 +- maixpy/doc/en/vision/image_ops.html | 41 +- maixpy/doc/en/vision/line_tracking.html | 536 ++++++ maixpy/doc/en/vision/maixhub_train.html | 41 +- maixpy/doc/en/vision/object_track.html | 41 +- maixpy/doc/en/vision/qrcode.html | 47 +- .../doc/en/vision/self_learn_classifier.html | 41 +- maixpy/doc/en/vision/self_learn_detector.html | 41 +- maixpy/doc/en/vision/yolov5.html | 45 +- maixpy/doc/zh/audio/recognize.html | 39 +- maixpy/doc/zh/basic/app.html | 39 +- maixpy/doc/zh/basic/app_usage.html | 39 +- maixpy/doc/zh/basic/linux_basic.html | 39 +- maixpy/doc/zh/basic/maixpy_upgrade.html | 39 +- maixpy/doc/zh/basic/maixvision.html | 85 +- maixpy/doc/zh/basic/os.html | 39 +- maixpy/doc/zh/basic/python.html | 39 +- maixpy/doc/zh/basic/python_pkgs.html | 39 +- maixpy/doc/zh/faq.html | 39 +- maixpy/doc/zh/index.html | 39 +- maixpy/doc/zh/modules/acc.html | 39 +- maixpy/doc/zh/modules/thermal_cam.html | 43 +- maixpy/doc/zh/modules/tof.html | 39 +- maixpy/doc/zh/peripheral/gpio.html | 85 +- maixpy/doc/zh/peripheral/i2c.html | 88 +- maixpy/doc/zh/peripheral/pwm.html | 91 +- maixpy/doc/zh/peripheral/spi.html | 52 +- maixpy/doc/zh/peripheral/uart.html | 104 +- maixpy/doc/zh/peripheral/wdt.html | 67 +- maixpy/doc/zh/pro/compile_os.html | 39 +- maixpy/doc/zh/projects/index.html | 357 ++++ .../doc/zh/projects/line_tracking_robot.html | 422 +++++ maixpy/doc/zh/sidebar.yaml | 224 +-- maixpy/doc/zh/source_code/add_c_module.html | 39 +- maixpy/doc/zh/source_code/build.html | 65 +- maixpy/doc/zh/source_code/contribute.html | 43 +- maixpy/doc/zh/source_code/faq.html | 45 +- maixpy/doc/zh/source_code/maixcdk.html | 39 +- maixpy/doc/zh/video/jpeg_streaming.html | 39 +- maixpy/doc/zh/vision/ai.html | 39 +- maixpy/doc/zh/vision/apriltag.html | 41 +- maixpy/doc/zh/vision/body_key_points.html | 39 +- maixpy/doc/zh/vision/camera.html | 39 +- maixpy/doc/zh/vision/classify.html | 39 +- maixpy/doc/zh/vision/custmize_model.html | 39 +- maixpy/doc/zh/vision/display.html | 39 +- maixpy/doc/zh/vision/face_detection.html | 375 ++++ maixpy/doc/zh/vision/face_recognition.html | 43 +- maixpy/doc/zh/vision/find_blobs.html | 47 +- maixpy/doc/zh/vision/image_ops.html | 39 +- maixpy/doc/zh/vision/line_tracking.html | 541 ++++++ maixpy/doc/zh/vision/maixhub_train.html | 39 +- maixpy/doc/zh/vision/object_track.html | 39 +- maixpy/doc/zh/vision/qrcode.html | 45 +- .../doc/zh/vision/self_learn_classifier.html | 39 +- maixpy/doc/zh/vision/self_learn_detector.html | 39 +- maixpy/doc/zh/vision/yolov5.html | 43 +- maixpy/sitemap.xml | 420 +++-- maixpy/static/image/line_tracking_demo.jpg | Bin 0 -> 11530 bytes maixpy/static/search_index/index_0.json | 2 +- maixpy/static/search_index/index_1.json | 2 +- maixpy/static/search_index/index_2.json | 2 +- maixpy/static/video/line_tracking_app.mp4 | Bin 0 -> 684590 bytes 144 files changed, 11754 insertions(+), 1489 deletions(-) create mode 100644 maixpy/api/maix/audio.html create mode 100644 maixpy/api/maix/peripheral/pinmap.html create mode 100644 maixpy/api/maix/rtmp.html create mode 100644 maixpy/doc/assets/face_detection.jpg create mode 100644 maixpy/doc/assets/maixvision_browser.jpg create mode 100644 maixpy/doc/assets/maixvision_browser2.jpg create mode 100644 maixpy/doc/en/projects/index.html create mode 100644 maixpy/doc/en/projects/line_tracking_robot.html create mode 100644 maixpy/doc/en/vision/face_detection.html create mode 100644 maixpy/doc/en/vision/line_tracking.html create mode 100644 maixpy/doc/zh/projects/index.html create mode 100644 maixpy/doc/zh/projects/line_tracking_robot.html create mode 100644 maixpy/doc/zh/vision/face_detection.html create mode 100644 maixpy/doc/zh/vision/line_tracking.html create mode 100644 maixpy/static/image/line_tracking_demo.jpg create mode 100644 maixpy/static/video/line_tracking_app.mp4 diff --git a/maixpy/api/api.json b/maixpy/api/api.json index bd09efe7..c661a434 100644 --- a/maixpy/api/api.json +++ b/maixpy/api/api.json @@ -552,6 +552,20 @@ "static": false, "def": "tensor::DType dtype()" }, + "to_float_list": { + "type": "func", + "name": "to_float_list", + "doc": { + "brief": "get tensor data and return a list", + "return": "list type data", + "maixpy": "maix.tensor.Tensor.to_float_list", + "py_doc": "get tensor data and return a list\n\nReturns: list type data\n" + }, + "args": [], + "ret_type": "std::valarray*", + "static": false, + "def": "std::valarray* to_float_list()" + }, "argmax": { "type": "func", "name": "argmax", @@ -5288,6 +5302,30 @@ "static": false, "def": "image::Image *to_format(const image::Format &format)" }, + "to_jpeg": { + "type": "func", + "name": "to_jpeg", + "doc": { + "brief": "Convert image to jpeg", + "param": { + "quality": "the quality of jpg, default is 95. range is (50, 100]." + }, + "return": "new image object. Need be delete by caller in C++.", + "throw": "err.Exception, if two images' format not support, **or already the format**, will raise exception", + "maixpy": "maix.image.Image.to_jpeg", + "py_doc": "Convert image to jpeg\n\nArgs:\n - quality: the quality of jpg, default is 95. range is (50, 100].\n\n\nReturns: new image object. Need be delete by caller in C++.\n" + }, + "args": [ + [ + "int", + "quality", + "95" + ] + ], + "ret_type": "image::Image*", + "static": false, + "def": "image::Image *to_jpeg(int quality = 95)" + }, "draw_image": { "type": "func", "name": "draw_image", @@ -5768,15 +5806,14 @@ "doc": { "brief": "Draw keypoints on image", "param": { - "keypoints": "keypoints, [x, y, rotation_andle_in_degrees], TODO: rotation_andle_in_degrees support in the feature", + "keypoints": "keypoints, [x1, y1, x2, y2...] or [x, y, rotation_andle_in_degrees, x2, y2, rotation_andle_in_degrees2](TODO: rotation_andle_in_degrees support in the feature)", "color": "keypoints color @see image::Color", "size": "size of keypoints", - "thickness": "keypoints thickness(line width), by default(value is 1)", - "fill": "if true, will fill keypoints, by default(value is false)" + "thickness": "keypoints thickness(line width), by default(value is -1 means fill circle)" }, "return": "this image object self", "maixpy": "maix.image.Image.draw_keypoints", - "py_doc": "Draw keypoints on image\n\nArgs:\n - keypoints: keypoints, [x, y, rotation_andle_in_degrees], TODO: rotation_andle_in_degrees support in the feature\n - color: keypoints color @see image::Color\n - size: size of keypoints\n - thickness: keypoints thickness(line width), by default(value is 1)\n - fill: if true, will fill keypoints, by default(value is false)\n\n\nReturns: this image object self\n" + "py_doc": "Draw keypoints on image\n\nArgs:\n - keypoints: keypoints, [x1, y1, x2, y2...] or [x, y, rotation_andle_in_degrees, x2, y2, rotation_andle_in_degrees2](TODO: rotation_andle_in_degrees support in the feature)\n - color: keypoints color @see image::Color\n - size: size of keypoints\n - thickness: keypoints thickness(line width), by default(value is -1 means fill circle)\n\n\nReturns: this image object self\n" }, "args": [ [ @@ -5797,17 +5834,12 @@ [ "int", "thickness", - "1" - ], - [ - "bool", - "fill", - "false" + "-1" ] ], "ret_type": "image::Image*", "static": false, - "def": "image::Image *draw_keypoints(std::vector keypoints, const image::Color &color, int size = 10, int thickness = 1, bool fill = false)" + "def": "image::Image *draw_keypoints(std::vector keypoints, const image::Color &color, int size = 10, int thickness = -1)" }, "resize": { "type": "func", @@ -6073,13 +6105,13 @@ "type": "func", "name": "compress", "doc": { - "brief": "JPEG compresses the image in place.", + "brief": "JPEG compresses the image in place, the same as to_jpeg functioin, it's recommend to use to_jpeg instead.", "param": { "quality": "The quality of the compressed image. default is 95." }, "return": "Returns the compressed JPEG image", "maixpy": "maix.image.Image.compress", - "py_doc": "JPEG compresses the image in place.\n\nArgs:\n - quality: The quality of the compressed image. default is 95.\n\n\nReturns: Returns the compressed JPEG image\n" + "py_doc": "JPEG compresses the image in place, the same as to_jpeg functioin, it's recommend to use to_jpeg instead.\n\nArgs:\n - quality: The quality of the compressed image. default is 95.\n\n\nReturns: Returns the compressed JPEG image\n" }, "args": [ [ @@ -9852,6 +9884,56 @@ "static": false, "def": "uint32_t saturation(uint32_t value = -1)", "py_def": "def saturation(self, value: int = -1) -> int" + }, + "awb_mode": { + "type": "func", + "name": "awb_mode", + "doc": { + "brief": "Set/Get white balance mode", + "attention": "This method will affect the isp and thus the image, so please be careful with it.", + "param": { + "value": "value = 0, means set white balance to auto mode, value = 1, means set white balance to manual mode, default is auto mode." + }, + "return": "returns awb mode", + "maixpy": "maix.camera.Camera.awb_mode", + "py_doc": "Set/Get white balance mode\n\nArgs:\n - value: value = 0, means set white balance to auto mode, value = 1, means set white balance to manual mode, default is auto mode.\n\n\nReturns: returns awb mode\n" + }, + "args": [ + [ + "uint32_t", + "value", + "-1" + ] + ], + "ret_type": "uint32_t", + "static": false, + "def": "uint32_t awb_mode(uint32_t value = -1)", + "py_def": "def awb_mode(self, value: int = -1) -> int" + }, + "exp_mode": { + "type": "func", + "name": "exp_mode", + "doc": { + "brief": "Set/Get exposure mode", + "attention": "This method will affect the isp and thus the image, so please be careful with it.", + "param": { + "value": "value = 0, means set exposure to auto mode, value = 1, means set exposure to manual mode, default is auto mode." + }, + "return": "returns exposure mode", + "maixpy": "maix.camera.Camera.exp_mode", + "py_doc": "Set/Get exposure mode\n\nArgs:\n - value: value = 0, means set exposure to auto mode, value = 1, means set exposure to manual mode, default is auto mode.\n\n\nReturns: returns exposure mode\n" + }, + "args": [ + [ + "uint32_t", + "value", + "-1" + ] + ], + "ret_type": "uint32_t", + "static": false, + "def": "uint32_t exp_mode(uint32_t value = -1)", + "py_def": "def exp_mode(self, value: int = -1) -> int" } }, "def": "class Camera" @@ -14571,7 +14653,8 @@ ], "ret_type": "std::vector*", "static": false, - "def": "std::vector *detect(image::Image &img, float conf_th = 0.5, float iou_th = 0.45, maix::image::Fit fit = maix::image::FIT_CONTAIN)" + "def": "std::vector *detect(image::Image &img, float conf_th = 0.5, float iou_th = 0.45, maix::image::Fit fit = maix::image::FIT_CONTAIN)", + "py_def": "def detect(self, img: maix.image.Image, conf_th: float = 0.5, iou_th: float = 0.45, fit: maix.image.Fit = ...) -> list[...]" }, "input_size": { "type": "func", @@ -14980,8 +15063,7 @@ ], "ret_type": null, "static": false, - "def": "MUD(const char *model_path = nullptr)", - "py_def": "def __init__(self, model_path: str = None) -> None" + "def": "MUD(const char *model_path = nullptr)" }, "load": { "type": "func", @@ -15078,7 +15160,8 @@ ], "ret_type": null, "static": false, - "def": "LayerInfo(const std::string &name = \"\", tensor::DType dtype = tensor::DType::FLOAT32, std::vector shape = std::vector())" + "def": "LayerInfo(const std::string &name = \"\", tensor::DType dtype = tensor::DType::FLOAT32, std::vector shape = std::vector())", + "py_def": "def __init__(self, name: str = '', dtype: maix.tensor.DType = ..., shape: list[int] = []) -> None" }, "name": { "type": "var", @@ -15131,7 +15214,8 @@ "args": [], "ret_type": "std::string", "static": false, - "def": "std::string to_str()" + "def": "std::string to_str()", + "py_def": "def to_str(self) -> str" }, "__str__": { "type": "func", @@ -15179,7 +15263,8 @@ ], "ret_type": null, "static": false, - "def": "NN(const std::string &model = \"\")" + "def": "NN(const std::string &model = \"\")", + "py_def": "def __init__(self, model: str = '') -> None" }, "load": { "type": "func", @@ -15217,7 +15302,8 @@ "args": [], "ret_type": "bool", "static": false, - "def": "bool loaded()" + "def": "bool loaded()", + "py_def": "def loaded(self) -> bool" }, "inputs_info": { "type": "func", @@ -15231,7 +15317,8 @@ "args": [], "ret_type": "std::vector", "static": false, - "def": "std::vector inputs_info()" + "def": "std::vector inputs_info()", + "py_def": "def inputs_info(self) -> list[LayerInfo]" }, "outputs_info": { "type": "func", @@ -15245,7 +15332,8 @@ "args": [], "ret_type": "std::vector", "static": false, - "def": "std::vector outputs_info()" + "def": "std::vector outputs_info()", + "py_def": "def outputs_info(self) -> list[LayerInfo]" }, "extra_info": { "type": "func", @@ -15259,7 +15347,8 @@ "args": [], "ret_type": "std::map", "static": false, - "def": "std::map extra_info()" + "def": "std::map extra_info()", + "py_def": "def extra_info(self) -> dict[str, str]" }, "forward": { "type": "func", @@ -15282,7 +15371,8 @@ ], "ret_type": "tensor::Tensors*", "static": false, - "def": "tensor::Tensors *forward(tensor::Tensors &inputs)" + "def": "tensor::Tensors *forward(tensor::Tensors &inputs)", + "py_def": "def forward(self, inputs: maix.tensor.Tensors) -> maix.tensor.Tensors" }, "forward_image": { "type": "func", @@ -15329,7 +15419,8 @@ ], "ret_type": "tensor::Tensors*", "static": false, - "def": "tensor::Tensors *forward_image(image::Image &img, std::vector mean = std::vector(), std::vector scale = std::vector(), image::Fit fit = image::Fit::FIT_FILL, bool copy_result = true)" + "def": "tensor::Tensors *forward_image(image::Image &img, std::vector mean = std::vector(), std::vector scale = std::vector(), image::Fit fit = image::Fit::FIT_FILL, bool copy_result = true)", + "py_def": "def forward_image(self, img: maix.image.Image, mean: list[float] = [], scale: list[float] = [], fit: maix.image.Fit = ..., copy_result: bool = True) -> maix.tensor.Tensors" } }, "def": "class NN" @@ -15374,166 +15465,1117 @@ }, "auto_add": true }, - "Object": { + "FaceDetector": { "type": "class", - "name": "Object", + "name": "FaceDetector", "doc": { - "brief": "Object for detect result", - "maixpy": "maix.nn.Object", - "py_doc": "Object for detect result" + "brief": "FaceDetector class", + "maixpy": "maix.nn.FaceDetector", + "py_doc": "FaceDetector class" }, "members": { "__init__": { "type": "func", - "name": "Object", + "name": "FaceDetector", "doc": { - "brief": "Constructor of Object for detect result", + "brief": "Constructor of FaceDetector class", "param": { - "x": "left top x", - "y": "left top y", - "w": "width", - "h": "height", - "class_id": "class id", - "score": "score" + "model": "model path, default empty, you can load model later by load function." }, - "maixpy": "maix.nn.Object.__init__", - "maixcdk": "maix.nn.Object.Object", - "py_doc": "Constructor of Object for detect result\n\nArgs:\n - x: left top x\n - y: left top y\n - w: width\n - h: height\n - class_id: class id\n - score: score\n" + "throw": "If model arg is not empty and load failed, will throw err::Exception.", + "maixpy": "maix.nn.FaceDetector.__init__", + "maixcdk": "maix.nn.FaceDetector.FaceDetector", + "py_doc": "Constructor of FaceDetector class\n\nArgs:\n - model: model path, default empty, you can load model later by load function.\n" }, "args": [ [ - "int", - "x", - "0" - ], + "const string &", + "model", + "\"\"" + ] + ], + "ret_type": null, + "static": false, + "def": "FaceDetector(const string &model = \"\")" + }, + "load": { + "type": "func", + "name": "load", + "doc": { + "brief": "Load model from file", + "param": { + "model": "Model path want to load" + }, + "return": "err::Err", + "maixpy": "maix.nn.FaceDetector.load", + "py_doc": "Load model from file\n\nArgs:\n - model: Model path want to load\n\n\nReturns: err::Err\n" + }, + "args": [ [ - "int", - "y", - "0" - ], + "const string &", + "model", + null + ] + ], + "ret_type": "err::Err", + "static": false, + "def": "err::Err load(const string &model)", + "py_def": "def load(self, model: str) -> maix.err.Err" + }, + "detect": { + "type": "func", + "name": "detect", + "doc": { + "brief": "Detect objects from image", + "param": { + "img": "Image want to detect, if image's size not match model input's, will auto resize with fit method.", + "conf_th": "Confidence threshold, default 0.5.", + "iou_th": "IoU threshold, default 0.45.", + "fit": "Resize method, default image.Fit.FIT_CONTAIN." + }, + "throw": "If image format not match model input format, will throw err::Exception.", + "return": "Object list. In C++, you should delete it after use.", + "maixpy": "maix.nn.FaceDetector.detect", + "py_doc": "Detect objects from image\n\nArgs:\n - img: Image want to detect, if image's size not match model input's, will auto resize with fit method.\n - conf_th: Confidence threshold, default 0.5.\n - iou_th: IoU threshold, default 0.45.\n - fit: Resize method, default image.Fit.FIT_CONTAIN.\n\n\nReturns: Object list. In C++, you should delete it after use.\n" + }, + "args": [ [ - "int", - "w", - "0" + "image::Image &", + "img", + null ], [ - "int", - "h", - "0" + "float", + "conf_th", + "0.5" ], [ - "int", - "class_id", - "0" + "float", + "iou_th", + "0.45" ], [ - "float", - "score", - "0" + "maix::image::Fit", + "fit", + "maix::image::FIT_CONTAIN" ] ], - "ret_type": null, + "ret_type": "std::vector*", "static": false, - "def": "Object(int x = 0, int y = 0, int w = 0, int h = 0, int class_id = 0, float score = 0)" + "def": "std::vector *detect(image::Image &img, float conf_th = 0.5, float iou_th = 0.45, maix::image::Fit fit = maix::image::FIT_CONTAIN)", + "py_def": "def detect(self, img: maix.image.Image, conf_th: float = 0.5, iou_th: float = 0.45, fit: maix.image.Fit = ...) -> list[...]" }, - "__str__": { + "input_size": { "type": "func", - "name": "to_str", + "name": "input_size", "doc": { - "brief": "Object info to string", - "return": "Object info string", - "maixpy": "maix.nn.Object.__str__", - "maixcdk": "maix.nn.Object.to_str", - "py_doc": "Object info to string\n\nReturns: Object info string\n" + "brief": "Get model input size", + "return": "model input size", + "maixpy": "maix.nn.FaceDetector.input_size", + "py_doc": "Get model input size\n\nReturns: model input size\n" }, "args": [], - "ret_type": "std::string", + "ret_type": "image::Size", "static": false, - "def": "std::string to_str()" + "def": "image::Size input_size()", + "py_def": "def input_size(self) -> maix.image.Size" }, - "x": { - "type": "var", - "name": "x", + "input_width": { + "type": "func", + "name": "input_width", "doc": { - "brief": "Object left top coordinate x", - "maixpy": "maix.nn.Object.x", - "py_doc": "Object left top coordinate x" + "brief": "Get model input width", + "return": "model input size of width", + "maixpy": "maix.nn.FaceDetector.input_width", + "py_doc": "Get model input width\n\nReturns: model input size of width\n" }, - "value": null, + "args": [], + "ret_type": "int", "static": false, - "readonly": false, - "def": "int x" + "def": "int input_width()", + "py_def": "def input_width(self) -> int" }, - "y": { - "type": "var", - "name": "y", + "input_height": { + "type": "func", + "name": "input_height", "doc": { - "brief": "Object left top coordinate y", - "maixpy": "maix.nn.Object.y", - "py_doc": "Object left top coordinate y" + "brief": "Get model input height", + "return": "model input size of height", + "maixpy": "maix.nn.FaceDetector.input_height", + "py_doc": "Get model input height\n\nReturns: model input size of height\n" }, - "value": null, + "args": [], + "ret_type": "int", "static": false, - "readonly": false, - "def": "int y" + "def": "int input_height()", + "py_def": "def input_height(self) -> int" }, - "w": { - "type": "var", - "name": "w", + "input_format": { + "type": "func", + "name": "input_format", "doc": { - "brief": "Object width", - "maixpy": "maix.nn.Object.w", - "py_doc": "Object width" + "brief": "Get input image format", + "return": "input image format, image::Format type.", + "maixpy": "maix.nn.FaceDetector.input_format", + "py_doc": "Get input image format\n\nReturns: input image format, image::Format type.\n" }, - "value": null, + "args": [], + "ret_type": "image::Format", "static": false, - "readonly": false, - "def": "int w" + "def": "image::Format input_format()", + "py_def": "def input_format(self) -> maix.image.Format" }, - "h": { + "mean": { "type": "var", - "name": "h", + "name": "mean", "doc": { - "brief": "Object height", - "maixpy": "maix.nn.Object.h", - "py_doc": "Object height" + "brief": "Get mean value, list type", + "maixpy": "maix.nn.FaceDetector.mean", + "py_doc": "Get mean value, list type" }, "value": null, "static": false, "readonly": false, - "def": "int h" + "def": "std::vector mean" }, - "class_id": { + "scale": { "type": "var", - "name": "class_id", + "name": "scale", "doc": { - "brief": "Object class id", - "maixpy": "maix.nn.Object.class_id", - "py_doc": "Object class id" + "brief": "Get scale value, list type", + "maixpy": "maix.nn.FaceDetector.scale", + "py_doc": "Get scale value, list type" + }, + "value": null, + "static": false, + "readonly": false, + "def": "std::vector scale" + } + }, + "def": "class FaceDetector" + }, + "Retinaface": { + "type": "class", + "name": "Retinaface", + "doc": { + "brief": "Retinaface class", + "maixpy": "maix.nn.Retinaface", + "py_doc": "Retinaface class" + }, + "members": { + "__init__": { + "type": "func", + "name": "Retinaface", + "doc": { + "brief": "Constructor of Retinaface class", + "param": { + "model": "model path, default empty, you can load model later by load function." + }, + "throw": "If model arg is not empty and load failed, will throw err::Exception.", + "maixpy": "maix.nn.Retinaface.__init__", + "maixcdk": "maix.nn.Retinaface.Retinaface", + "py_doc": "Constructor of Retinaface class\n\nArgs:\n - model: model path, default empty, you can load model later by load function.\n" + }, + "args": [ + [ + "const string &", + "model", + "\"\"" + ] + ], + "ret_type": null, + "static": false, + "def": "Retinaface(const string &model = \"\")" + }, + "load": { + "type": "func", + "name": "load", + "doc": { + "brief": "Load model from file", + "param": { + "model": "Model path want to load" + }, + "return": "err::Err", + "maixpy": "maix.nn.Retinaface.load", + "py_doc": "Load model from file\n\nArgs:\n - model: Model path want to load\n\n\nReturns: err::Err\n" + }, + "args": [ + [ + "const string &", + "model", + null + ] + ], + "ret_type": "err::Err", + "static": false, + "def": "err::Err load(const string &model)", + "py_def": "def load(self, model: str) -> maix.err.Err" + }, + "detect": { + "type": "func", + "name": "detect", + "doc": { + "brief": "Detect objects from image", + "param": { + "img": "Image want to detect, if image's size not match model input's, will auto resize with fit method.", + "conf_th": "Confidence threshold, default 0.4.", + "iou_th": "IoU threshold, default 0.45.", + "fit": "Resize method, default image.Fit.FIT_CONTAIN." + }, + "throw": "If image format not match model input format, will throw err::Exception.", + "return": "Object list. In C++, you should delete it after use.", + "maixpy": "maix.nn.Retinaface.detect", + "py_doc": "Detect objects from image\n\nArgs:\n - img: Image want to detect, if image's size not match model input's, will auto resize with fit method.\n - conf_th: Confidence threshold, default 0.4.\n - iou_th: IoU threshold, default 0.45.\n - fit: Resize method, default image.Fit.FIT_CONTAIN.\n\n\nReturns: Object list. In C++, you should delete it after use.\n" + }, + "args": [ + [ + "image::Image &", + "img", + null + ], + [ + "float", + "conf_th", + "0.4" + ], + [ + "float", + "iou_th", + "0.45" + ], + [ + "maix::image::Fit", + "fit", + "maix::image::FIT_CONTAIN" + ] + ], + "ret_type": "std::vector*", + "static": false, + "def": "std::vector *detect(image::Image &img, float conf_th = 0.4, float iou_th = 0.45, maix::image::Fit fit = maix::image::FIT_CONTAIN)", + "py_def": "def detect(self, img: maix.image.Image, conf_th: float = 0.5, iou_th: float = 0.45, fit: maix.image.Fit = ...) -> list[...]" + }, + "input_size": { + "type": "func", + "name": "input_size", + "doc": { + "brief": "Get model input size", + "return": "model input size", + "maixpy": "maix.nn.Retinaface.input_size", + "py_doc": "Get model input size\n\nReturns: model input size\n" + }, + "args": [], + "ret_type": "image::Size", + "static": false, + "def": "image::Size input_size()", + "py_def": "def input_size(self) -> maix.image.Size" + }, + "input_width": { + "type": "func", + "name": "input_width", + "doc": { + "brief": "Get model input width", + "return": "model input size of width", + "maixpy": "maix.nn.Retinaface.input_width", + "py_doc": "Get model input width\n\nReturns: model input size of width\n" + }, + "args": [], + "ret_type": "int", + "static": false, + "def": "int input_width()", + "py_def": "def input_width(self) -> int" + }, + "input_height": { + "type": "func", + "name": "input_height", + "doc": { + "brief": "Get model input height", + "return": "model input size of height", + "maixpy": "maix.nn.Retinaface.input_height", + "py_doc": "Get model input height\n\nReturns: model input size of height\n" + }, + "args": [], + "ret_type": "int", + "static": false, + "def": "int input_height()", + "py_def": "def input_height(self) -> int" + }, + "input_format": { + "type": "func", + "name": "input_format", + "doc": { + "brief": "Get input image format", + "return": "input image format, image::Format type.", + "maixpy": "maix.nn.Retinaface.input_format", + "py_doc": "Get input image format\n\nReturns: input image format, image::Format type.\n" + }, + "args": [], + "ret_type": "image::Format", + "static": false, + "def": "image::Format input_format()", + "py_def": "def input_format(self) -> maix.image.Format" + }, + "mean": { + "type": "var", + "name": "mean", + "doc": { + "brief": "Get mean value, list type", + "maixpy": "maix.nn.Retinaface.mean", + "py_doc": "Get mean value, list type" + }, + "value": null, + "static": false, + "readonly": false, + "def": "std::vector mean" + }, + "scale": { + "type": "var", + "name": "scale", + "doc": { + "brief": "Get scale value, list type", + "maixpy": "maix.nn.Retinaface.scale", + "py_doc": "Get scale value, list type" + }, + "value": null, + "static": false, + "readonly": false, + "def": "std::vector scale" + } + }, + "def": "class Retinaface" + }, + "Object": { + "type": "class", + "name": "Object", + "doc": { + "brief": "Object for detect result", + "maixpy": "maix.nn.Object", + "py_doc": "Object for detect result" + }, + "members": { + "__init__": { + "type": "func", + "name": "Object", + "doc": { + "brief": "Constructor of Object for detect result", + "param": { + "x": "left top x", + "y": "left top y", + "w": "width", + "h": "height", + "class_id": "class id", + "score": "score" + }, + "maixpy": "maix.nn.Object.__init__", + "maixcdk": "maix.nn.Object.Object", + "py_doc": "Constructor of Object for detect result\n\nArgs:\n - x: left top x\n - y: left top y\n - w: width\n - h: height\n - class_id: class id\n - score: score\n" + }, + "args": [ + [ + "int", + "x", + "0" + ], + [ + "int", + "y", + "0" + ], + [ + "int", + "w", + "0" + ], + [ + "int", + "h", + "0" + ], + [ + "int", + "class_id", + "0" + ], + [ + "float", + "score", + "0" + ], + [ + "std::vector", + "points", + "std::vector()" + ] + ], + "ret_type": null, + "static": false, + "def": "Object(int x = 0, int y = 0, int w = 0, int h = 0, int class_id = 0, float score = 0, std::vector points = std::vector())" + }, + "__str__": { + "type": "func", + "name": "to_str", + "doc": { + "brief": "Object info to string", + "return": "Object info string", + "maixpy": "maix.nn.Object.__str__", + "maixcdk": "maix.nn.Object.to_str", + "py_doc": "Object info to string\n\nReturns: Object info string\n" + }, + "args": [], + "ret_type": "std::string", + "static": false, + "def": "std::string to_str()", + "py_def": "def to_str(self) -> str" + }, + "x": { + "type": "var", + "name": "x", + "doc": { + "brief": "Object left top coordinate x", + "maixpy": "maix.nn.Object.x", + "py_doc": "Object left top coordinate x" + }, + "value": null, + "static": false, + "readonly": false, + "def": "int x" + }, + "y": { + "type": "var", + "name": "y", + "doc": { + "brief": "Object left top coordinate y", + "maixpy": "maix.nn.Object.y", + "py_doc": "Object left top coordinate y" + }, + "value": null, + "static": false, + "readonly": false, + "def": "int y" + }, + "w": { + "type": "var", + "name": "w", + "doc": { + "brief": "Object width", + "maixpy": "maix.nn.Object.w", + "py_doc": "Object width" + }, + "value": null, + "static": false, + "readonly": false, + "def": "int w" + }, + "h": { + "type": "var", + "name": "h", + "doc": { + "brief": "Object height", + "maixpy": "maix.nn.Object.h", + "py_doc": "Object height" + }, + "value": null, + "static": false, + "readonly": false, + "def": "int h" + }, + "class_id": { + "type": "var", + "name": "class_id", + "doc": { + "brief": "Object class id", + "maixpy": "maix.nn.Object.class_id", + "py_doc": "Object class id" }, "value": null, "static": false, "readonly": false, "def": "int class_id" }, - "score": { - "type": "var", - "name": "score", + "score": { + "type": "var", + "name": "score", + "doc": { + "brief": "Object score", + "maixpy": "maix.nn.Object.score", + "py_doc": "Object score" + }, + "value": null, + "static": false, + "readonly": false, + "def": "float score" + }, + "points": { + "type": "var", + "name": "points", + "doc": { + "brief": "keypoints", + "maixpy": "maix.nn.Object.points", + "py_doc": "keypoints" + }, + "value": null, + "static": false, + "readonly": false, + "def": "std::vector points" + } + }, + "def": "class Object" + }, + "ObjectFloat": { + "type": "class", + "name": "ObjectFloat", + "doc": { + "brief": "Object for detect result", + "maixpy": "maix.nn.ObjectFloat", + "py_doc": "Object for detect result" + }, + "members": { + "__init__": { + "type": "func", + "name": "ObjectFloat", + "doc": { + "brief": "Constructor of Object for detect result", + "param": { + "x": "left top x", + "y": "left top y", + "w": "width", + "h": "height", + "class_id": "class id", + "score": "score" + }, + "maixpy": "maix.nn.ObjectFloat.__init__", + "maixcdk": "maix.nn.ObjectFloat.ObjectFloat", + "py_doc": "Constructor of Object for detect result\n\nArgs:\n - x: left top x\n - y: left top y\n - w: width\n - h: height\n - class_id: class id\n - score: score\n" + }, + "args": [ + [ + "float", + "x", + "0" + ], + [ + "float", + "y", + "0" + ], + [ + "float", + "w", + "0" + ], + [ + "float", + "h", + "0" + ], + [ + "float", + "class_id", + "0" + ], + [ + "float", + "score", + "0" + ], + [ + "std::vector", + "points", + "std::vector()" + ] + ], + "ret_type": null, + "static": false, + "def": "ObjectFloat(float x = 0, float y = 0, float w = 0, float h = 0, float class_id = 0, float score = 0, std::vector points = std::vector())" + }, + "__str__": { + "type": "func", + "name": "to_str", + "doc": { + "brief": "Object info to string", + "return": "Object info string", + "maixpy": "maix.nn.ObjectFloat.__str__", + "maixcdk": "maix.nn.ObjectFloat.to_str", + "py_doc": "Object info to string\n\nReturns: Object info string\n" + }, + "args": [], + "ret_type": "std::string", + "static": false, + "def": "std::string to_str()", + "py_def": "def to_str(self) -> str" + }, + "x": { + "type": "var", + "name": "x", + "doc": { + "brief": "Object left top coordinate x", + "maixpy": "maix.nn.ObjectFloat.x", + "py_doc": "Object left top coordinate x" + }, + "value": null, + "static": false, + "readonly": false, + "def": "float x" + }, + "y": { + "type": "var", + "name": "y", + "doc": { + "brief": "Object left top coordinate y", + "maixpy": "maix.nn.ObjectFloat.y", + "py_doc": "Object left top coordinate y" + }, + "value": null, + "static": false, + "readonly": false, + "def": "float y" + }, + "w": { + "type": "var", + "name": "w", + "doc": { + "brief": "Object width", + "maixpy": "maix.nn.ObjectFloat.w", + "py_doc": "Object width" + }, + "value": null, + "static": false, + "readonly": false, + "def": "float w" + }, + "h": { + "type": "var", + "name": "h", + "doc": { + "brief": "Object height", + "maixpy": "maix.nn.ObjectFloat.h", + "py_doc": "Object height" + }, + "value": null, + "static": false, + "readonly": false, + "def": "float h" + }, + "class_id": { + "type": "var", + "name": "class_id", + "doc": { + "brief": "Object class id", + "maixpy": "maix.nn.ObjectFloat.class_id", + "py_doc": "Object class id" + }, + "value": null, + "static": false, + "readonly": false, + "def": "float class_id" + }, + "score": { + "type": "var", + "name": "score", + "doc": { + "brief": "Object score", + "maixpy": "maix.nn.ObjectFloat.score", + "py_doc": "Object score" + }, + "value": null, + "static": false, + "readonly": false, + "def": "float score" + }, + "points": { + "type": "var", + "name": "points", + "doc": { + "brief": "keypoints", + "maixpy": "maix.nn.ObjectFloat.points", + "py_doc": "keypoints" + }, + "value": null, + "static": false, + "readonly": false, + "def": "std::vector points" + } + }, + "def": "class ObjectFloat" + } + }, + "auto_add": true + }, + "audio": { + "type": "module", + "doc": { + "brief": "maix.audio module", + "maixpy": "maix.audio", + "py_doc": "maix.audio module" + }, + "members": { + "Format": { + "type": "enum", + "name": "Format", + "doc": { + "brief": "Audio type", + "maixpy": "maix.audio.Format", + "py_doc": "Audio type" + }, + "values": [ + [ + "FMT_NONE", + "0", + "format invalid" + ], + [ + "FMT_S8", + "", + "unsigned 8 bits" + ], + [ + "FMT_S16_LE", + "", + "signed 16 bits, little endian" + ], + [ + "FMT_S32_LE", + "", + "signed 32 bits, little endian" + ], + [ + "FMT_S16_BE", + "", + "signed 16 bits, big endian" + ], + [ + "FMT_S32_BE", + "", + "signed 32 bits, big endian" + ], + [ + "FMT_U8", + "", + "unsigned 8 bits" + ], + [ + "FMT_U16_LE", + "", + "unsigned 16 bits, little endian" + ], + [ + "FMT_U32_LE", + "", + "unsigned 32 bits, little endian" + ], + [ + "FMT_U16_BE", + "", + "unsigned 16 bits, big endian" + ], + [ + "FMT_U32_BE", + "", + "unsigned 32 bits, big endian" + ] + ], + "def": "enum Format\n {\n FMT_NONE = 0, // format invalid\n FMT_S8, // unsigned 8 bits\n FMT_S16_LE, // signed 16 bits, little endian\n FMT_S32_LE, // signed 32 bits, little endian\n FMT_S16_BE, // signed 16 bits, big endian\n FMT_S32_BE, // signed 32 bits, big endian\n FMT_U8, // unsigned 8 bits\n FMT_U16_LE, // unsigned 16 bits, little endian\n FMT_U32_LE, // unsigned 32 bits, little endian\n FMT_U16_BE, // unsigned 16 bits, big endian\n FMT_U32_BE, // unsigned 32 bits, big endian\n }" + }, + "Recorder": { + "type": "class", + "name": "Recorder", + "doc": { + "brief": "Recorder class", + "maixpy": "maix.audio.Recorder", + "py_doc": "Recorder class" + }, + "members": { + "__init__": { + "type": "func", + "name": "Recorder", + "doc": { + "brief": "Construct a new Recorder object", + "param": { + "path": "record path. the path determines the location where you save the file, if path is none, the audio module will not save file.", + "sample_rate": "record sample rate, default is 48000(48KHz), means 48000 samples per second.", + "format": "record sample format, default is audio::Format::FMT_S16_LE, means sampling 16 bits at a time and save as signed 16 bits, little endian. see @audio::Format", + "channel": "record sample channel, default is 1, means 1 channel sampling at the same time" + }, + "maixpy": "maix.audio.Recorder.__init__", + "maixcdk": "maix.audio.Recorder.Recorder", + "py_doc": "Construct a new Recorder object\n\nArgs:\n - path: record path. the path determines the location where you save the file, if path is none, the audio module will not save file.\n - sample_rate: record sample rate, default is 48000(48KHz), means 48000 samples per second.\n - format: record sample format, default is audio::Format::FMT_S16_LE, means sampling 16 bits at a time and save as signed 16 bits, little endian. see @audio::Format\n - channel: record sample channel, default is 1, means 1 channel sampling at the same time\n" + }, + "args": [ + [ + "std::string", + "path", + "std::string()" + ], + [ + "int", + "sample_rate", + "48000" + ], + [ + "audio::Format", + "format", + "audio::Format::FMT_S16_LE" + ], + [ + "int", + "channel", + "1" + ] + ], + "ret_type": null, + "static": false, + "def": "Recorder(std::string path = std::string(), int sample_rate = 48000, audio::Format format = audio::Format::FMT_S16_LE, int channel = 1)" + }, + "volume": { + "type": "func", + "name": "volume", + "doc": { + "brief": "Set/Get record volume", + "param": { + "value": "volume value, If you use this parameter, audio will set the value to volume,\nif you don't, it will return the current volume." + }, + "return": "the current volume", + "maixpy": "maix.audio.Recorder.volume", + "py_doc": "Set/Get record volume\n\nArgs:\n - value: volume value, If you use this parameter, audio will set the value to volume,\nif you don't, it will return the current volume.\n\n\nReturns: the current volume\n" + }, + "args": [ + [ + "int", + "value", + "-1" + ] + ], + "ret_type": "int", + "static": false, + "def": "int volume(int value = -1)" + }, + "record": { + "type": "func", + "name": "record", + "doc": { + "brief": "Record, Read all cached data in buffer and return.", + "param": { + "record_ms": "record time. unit: ms", + "sample_rate": "audio sample rate", + "format": "audio sample format", + "channel": "audio sample channel" + }, + "return": "pcm data. datatype @see Bytes. If you pass in record_ms parameter, the return value is an empty Bytes object.", + "maixpy": "maix.audio.Recorder.record", + "py_doc": "Record, Read all cached data in buffer and return.\n\nArgs:\n - record_ms: record time. unit: ms\n - sample_rate: audio sample rate\n - format: audio sample format\n - channel: audio sample channel\n\n\nReturns: pcm data. datatype @see Bytes. If you pass in record_ms parameter, the return value is an empty Bytes object.\n" + }, + "args": [ + [ + "int", + "record_ms", + "-1" + ] + ], + "ret_type": "maix::Bytes*", + "static": false, + "def": "maix::Bytes *record(int record_ms = -1)" + }, + "finish": { + "type": "func", + "name": "finish", + "doc": { + "brief": "Finish the record, if you have passed in the path, this api will save the audio data to file.", + "return": "error code, err::ERR_NONE means success, others means failed", + "maixpy": "maix.audio.Recorder.finish", + "py_doc": "Finish the record, if you have passed in the path, this api will save the audio data to file.\n\nReturns: error code, err::ERR_NONE means success, others means failed\n" + }, + "args": [], + "ret_type": "err::Err", + "static": false, + "def": "err::Err finish()" + }, + "sample_rate": { + "type": "func", + "name": "sample_rate", + "doc": { + "brief": "Get sample rate", + "return": "returns sample rate", + "maixpy": "maix.audio.Recorder.sample_rate", + "py_doc": "Get sample rate\n\nReturns: returns sample rate\n" + }, + "args": [], + "ret_type": "int", + "static": false, + "def": "int sample_rate()" + }, + "format": { + "type": "func", + "name": "format", + "doc": { + "brief": "Get sample format", + "return": "returns sample format", + "maixpy": "maix.audio.Recorder.format", + "py_doc": "Get sample format\n\nReturns: returns sample format\n" + }, + "args": [], + "ret_type": "audio::Format", + "static": false, + "def": "audio::Format format()" + }, + "channel": { + "type": "func", + "name": "channel", + "doc": { + "brief": "Get sample channel", + "return": "returns sample channel", + "maixpy": "maix.audio.Recorder.channel", + "py_doc": "Get sample channel\n\nReturns: returns sample channel\n" + }, + "args": [], + "ret_type": "int", + "static": false, + "def": "int channel()" + } + }, + "def": "class Recorder" + }, + "Player": { + "type": "class", + "name": "Player", + "doc": { + "brief": "Player class", + "maixpy": "maix.audio.Player", + "py_doc": "Player class" + }, + "members": { + "__init__": { + "type": "func", + "name": "Player", + "doc": { + "brief": "Construct a new Player object", + "param": { + "path": "player path. the path determines the location where you save the file, if path is none, the audio module will not save file.", + "sample_rate": "player sample rate, default is 48000(48KHz), means 48000 samples per second.", + "format": "player sample format, default is audio::Format::FMT_S16_LE, means sampling 16 bits at a time and save as signed 16 bits, little endian. see @audio::Format", + "channel": "player sample channel, default is 1, means 1 channel sampling at the same time" + }, + "maixpy": "maix.audio.Player.__init__", + "maixcdk": "maix.audio.Player.Player", + "py_doc": "Construct a new Player object\n\nArgs:\n - path: player path. the path determines the location where you save the file, if path is none, the audio module will not save file.\n - sample_rate: player sample rate, default is 48000(48KHz), means 48000 samples per second.\n - format: player sample format, default is audio::Format::FMT_S16_LE, means sampling 16 bits at a time and save as signed 16 bits, little endian. see @audio::Format\n - channel: player sample channel, default is 1, means 1 channel sampling at the same time\n" + }, + "args": [ + [ + "std::string", + "path", + "std::string()" + ], + [ + "int", + "sample_rate", + "48000" + ], + [ + "audio::Format", + "format", + "audio::Format::FMT_S16_LE" + ], + [ + "int", + "channel", + "1" + ] + ], + "ret_type": null, + "static": false, + "def": "Player(std::string path = std::string(), int sample_rate = 48000, audio::Format format = audio::Format::FMT_S16_LE, int channel = 1)" + }, + "volume": { + "type": "func", + "name": "volume", "doc": { - "brief": "Object score", - "maixpy": "maix.nn.Object.score", - "py_doc": "Object score" + "brief": "Set/Get player volume(Not support now)", + "param": { + "value": "volume value, If you use this parameter, audio will set the value to volume,\nif you don't, it will return the current volume." + }, + "return": "the current volume", + "maixpy": "maix.audio.Player.volume", + "py_doc": "Set/Get player volume(Not support now)\n\nArgs:\n - value: volume value, If you use this parameter, audio will set the value to volume,\nif you don't, it will return the current volume.\n\n\nReturns: the current volume\n" }, - "value": null, + "args": [ + [ + "int", + "value", + "-1" + ] + ], + "ret_type": "int", "static": false, - "readonly": false, - "def": "float score" + "def": "int volume(int value = -1)" + }, + "play": { + "type": "func", + "name": "play", + "doc": { + "brief": "Play", + "param": { + "data": "audio data, must be raw data" + }, + "return": "error code, err::ERR_NONE means success, others means failed", + "maixpy": "maix.audio.Player.play", + "py_doc": "Play\n\nArgs:\n - data: audio data, must be raw data\n\n\nReturns: error code, err::ERR_NONE means success, others means failed\n" + }, + "args": [ + [ + "maix::Bytes *", + "data", + "maix::audio::Player::NoneBytes" + ] + ], + "ret_type": "err::Err", + "static": false, + "def": "err::Err play(maix::Bytes *data = maix::audio::Player::NoneBytes)" + }, + "sample_rate": { + "type": "func", + "name": "sample_rate", + "doc": { + "brief": "Get sample rate", + "return": "returns sample rate", + "maixpy": "maix.audio.Player.sample_rate", + "py_doc": "Get sample rate\n\nReturns: returns sample rate\n" + }, + "args": [], + "ret_type": "int", + "static": false, + "def": "int sample_rate()" + }, + "format": { + "type": "func", + "name": "format", + "doc": { + "brief": "Get sample format", + "return": "returns sample format", + "maixpy": "maix.audio.Player.format", + "py_doc": "Get sample format\n\nReturns: returns sample format\n" + }, + "args": [], + "ret_type": "audio::Format", + "static": false, + "def": "audio::Format format()" + }, + "channel": { + "type": "func", + "name": "channel", + "doc": { + "brief": "Get sample channel", + "return": "returns sample channel", + "maixpy": "maix.audio.Player.channel", + "py_doc": "Get sample channel\n\nReturns: returns sample channel\n" + }, + "args": [], + "ret_type": "int", + "static": false, + "def": "int channel()" } }, - "def": "class Object" + "def": "class Player" } }, - "auto_add": true + "auto_add": false }, "peripheral": { "type": "module", @@ -15666,6 +16708,85 @@ }, "auto_add": true }, + "pinmap": { + "type": "module", + "doc": { + "brief": "maix.peripheral.pinmap module" + }, + "members": { + "get_pins": { + "type": "func", + "name": "get_pins", + "doc": { + "brief": "Get all pins of devices", + "return": "pin name list, string type.", + "maixpy": "maix.peripheral.pinmap.get_pins", + "py_doc": "Get all pins of devices\n\nReturns: pin name list, string type.\n" + }, + "args": [], + "ret_type": "std::vector", + "static": false, + "def": "std::vector get_pins()", + "py_def": "def get_pins() -> list[str]" + }, + "get_pin_functions": { + "type": "func", + "name": "get_pin_functions", + "doc": { + "brief": "Get all function of a pin", + "param": { + "pin": "pin name, string type." + }, + "return": "function list, function name is string type.", + "throw": "If pin name error will throwout err.Err.ERR_ARGS error.", + "maixpy": "maix.peripheral.pinmap.get_pin_functions", + "py_doc": "Get all function of a pin\n\nArgs:\n - pin: pin name, string type.\n\n\nReturns: function list, function name is string type.\n" + }, + "args": [ + [ + "const std::string &", + "pin", + null + ] + ], + "ret_type": "std::vector", + "static": false, + "def": "std::vector get_pin_functions(const std::string &pin)", + "py_def": "def get_pin_functions(pin: str) -> list[str]" + }, + "set_pin_function": { + "type": "func", + "name": "set_pin_function", + "doc": { + "brief": "Set function of a pin", + "param": { + "pin": "pin name, string type.", + "func": "which function should this pin use." + }, + "return": "if set ok, will return err.Err.ERR_NONE, else error occurs.", + "maixpy": "maix.peripheral.pinmap.set_pin_function", + "py_doc": "Set function of a pin\n\nArgs:\n - pin: pin name, string type.\n - func: which function should this pin use.\n\n\nReturns: if set ok, will return err.Err.ERR_NONE, else error occurs.\n" + }, + "args": [ + [ + "const std::string &", + "pin", + null + ], + [ + "const std::string &", + "func", + null + ] + ], + "ret_type": "err::Err", + "static": false, + "def": "err::Err set_pin_function(const std::string &pin, const std::string &func)", + "py_def": "def set_pin_function(pin: str, func: str) -> maix.err.Err" + } + }, + "auto_add": true + }, "pwm": { "type": "module", "doc": { @@ -17302,6 +18423,161 @@ }, "auto_add": true }, + "rtmp": { + "type": "module", + "doc": { + "brief": "maix.rtmp module" + }, + "members": { + "Rtmp": { + "type": "class", + "name": "Rtmp", + "doc": { + "brief": "Rtmp class", + "maixpy": "maix.rtmp.Rtmp", + "py_doc": "Rtmp class" + }, + "members": { + "__init__": { + "type": "func", + "name": "Rtmp", + "doc": { + "brief": "Construct a new Video object", + "note": "Rtmp url : rtmp://host:prot/app/stream\nexample:\nr = Rtmp(\"localhost\", 1935, \"live\", \"stream\")\nmeans rtmp url is rtmp://localhost:1935/live/stream", + "param": { + "host": "rtmp ip", + "port": "rtmp port, default is 1935.", + "app": "rtmp app name", + "stream": "rtmp stream name" + }, + "maixpy": "maix.rtmp.Rtmp.__init__", + "maixcdk": "maix.rtmp.Rtmp.Rtmp", + "py_doc": "Construct a new Video object\n\nArgs:\n - host: rtmp ip\n - port: rtmp port, default is 1935.\n - app: rtmp app name\n - stream: rtmp stream name\n" + }, + "args": [ + [ + "std::string", + "host", + null + ], + [ + "int", + "port", + "1935" + ], + [ + "std::string", + "app", + "std::string()" + ], + [ + "std::string", + "stream", + "std::string()" + ] + ], + "ret_type": null, + "static": false, + "def": "Rtmp(std::string host, int port = 1935, std::string app = std::string(), std::string stream = std::string())" + }, + "bind_camera": { + "type": "func", + "name": "bind_camera", + "doc": { + "brief": "Bind camera", + "note": "If the cam object is bound, the cam object cannot be used elsewhere.", + "param": { + "cam": "camera object" + }, + "return": "error code, err::ERR_NONE means success, others means failed", + "maixpy": "maix.rtmp.Rtmp.bind_camera", + "py_doc": "Bind camera\n\nArgs:\n - cam: camera object\n\n\nReturns: error code, err::ERR_NONE means success, others means failed\n" + }, + "args": [ + [ + "camera::Camera *", + "cam", + null + ] + ], + "ret_type": "err::Err", + "static": false, + "def": "err::Err bind_camera(camera::Camera *cam)" + }, + "start": { + "type": "func", + "name": "start", + "doc": { + "brief": "Start push stream", + "note": "only support flv file now", + "param": { + "path": "File path, if you passed file path, cyclic push the file, else if you bound camera, push the camera image." + }, + "return": "error code, err::ERR_NONE means success, others means failed", + "maixpy": "maix.rtmp.Rtmp.start", + "py_doc": "Start push stream\n\nArgs:\n - path: File path, if you passed file path, cyclic push the file, else if you bound camera, push the camera image.\n\n\nReturns: error code, err::ERR_NONE means success, others means failed\n" + }, + "args": [ + [ + "std::string", + "path", + "std::string()" + ] + ], + "ret_type": "err::Err", + "static": false, + "def": "err::Err start(std::string path = std::string())" + }, + "stop": { + "type": "func", + "name": "stop", + "doc": { + "brief": "Stop push", + "return": "error code, err::ERR_NONE means success, others means failed", + "maixpy": "maix.rtmp.Rtmp.stop", + "py_doc": "Stop push\n\nReturns: error code, err::ERR_NONE means success, others means failed\n" + }, + "args": [], + "ret_type": "err::Err", + "static": false, + "def": "err::Err stop()" + }, + "get_path": { + "type": "func", + "name": "get_path", + "doc": { + "brief": "Get the file path of the push stream", + "return": "file path", + "maixpy": "maix.rtmp.Rtmp.get_path", + "py_doc": "Get the file path of the push stream\n\nReturns: file path\n" + }, + "args": [], + "ret_type": "std::string", + "static": false, + "def": "std::string get_path()", + "overload": [ + { + "type": "func", + "name": "is_started", + "doc": { + "brief": "Check whether push streaming has started", + "return": "If rtmp thread is running, returns true", + "maixpy": "maix.rtmp.Rtmp.get_path", + "py_doc": "Check whether push streaming has started\n\nReturns: If rtmp thread is running, returns true\n" + }, + "args": [], + "ret_type": "bool", + "static": false, + "def": "bool is_started()" + } + ] + } + }, + "def": "class Rtmp" + } + }, + "auto_add": true + }, "rtsp": { "type": "module", "doc": { @@ -17930,11 +19206,12 @@ "format": "picture pixel format. this value may be set automatically. default is FMT_YVU420SP.", "time_base": "frame time base. time_base default is 30, means 1/30 ms", "framerate": "frame rate. framerate default is 30, means 30 frames per second\nfor video. 1/time_base is not the average frame rate if the frame rate is not constant.", - "open": "If true, vido will automatically call open() after creation. default is true." + "capture": "enable capture, if true, you can use capture() function to get an image object", + "open": "If true, video will automatically call open() after creation. default is true." }, "maixpy": "maix.video.Video.__init__", "maixcdk": "maix.video.Video.Video", - "py_doc": "Construct a new Video object\n\nArgs:\n - path: video path. the path determines the location where you load or save the file, if path is none, the video module will not save or load file.\nxxx.h265 means video format is H265, xxx.mp4 means video format is MP4\n - width: picture width. this value may be set automatically. default is 2560.\n - height: picture height. this value may be set automatically. default is 1440.\n - format: picture pixel format. this value may be set automatically. default is FMT_YVU420SP.\n - time_base: frame time base. time_base default is 30, means 1/30 ms\n - framerate: frame rate. framerate default is 30, means 30 frames per second\nfor video. 1/time_base is not the average frame rate if the frame rate is not constant.\n - open: If true, vido will automatically call open() after creation. default is true.\n" + "py_doc": "Construct a new Video object\n\nArgs:\n - path: video path. the path determines the location where you load or save the file, if path is none, the video module will not save or load file.\nxxx.h265 means video format is H265, xxx.mp4 means video format is MP4\n - width: picture width. this value may be set automatically. default is 2560.\n - height: picture height. this value may be set automatically. default is 1440.\n - format: picture pixel format. this value may be set automatically. default is FMT_YVU420SP.\n - time_base: frame time base. time_base default is 30, means 1/30 ms\n - framerate: frame rate. framerate default is 30, means 30 frames per second\nfor video. 1/time_base is not the average frame rate if the frame rate is not constant.\n - capture: enable capture, if true, you can use capture() function to get an image object\n - open: If true, video will automatically call open() after creation. default is true.\n" }, "args": [ [ @@ -17967,6 +19244,11 @@ "framerate", "30" ], + [ + "bool", + "capture", + "false" + ], [ "bool", "open", @@ -17975,8 +19257,8 @@ ], "ret_type": null, "static": false, - "def": "Video(std::string path = std::string(), int width = 2560, int height = 1440, image::Format format = image::Format::FMT_YVU420SP, int time_base = 30, int framerate = 30, bool open = true)", - "py_def": "def __init__(self, path: str = '', width: int = 2560, height: int = 1440, format: maix.image.Format = ..., time_base: int = 30, framerate: int = 30, open: bool = True) -> None" + "def": "Video(std::string path = std::string(), int width = 2560, int height = 1440, image::Format format = image::Format::FMT_YVU420SP, int time_base = 30, int framerate = 30, bool capture = false, bool open = true)", + "py_def": "def __init__(self, path: str = '', width: int = 2560, height: int = 1440, format: maix.image.Format = ..., time_base: int = 30, framerate: int = 30, capture: bool = False, open: bool = True) -> None" }, "open": { "type": "func", @@ -18052,23 +19334,23 @@ "doc": { "brief": "Encode image.", "param": { - "img": "the image will be encode.\nif the img is NULL, this function will try to get image from camera, you must use bind_camera to bind camera." + "img": "the image will be encode.\nif the img is NULL, this function will try to get image from camera, you must use bind_camera() function to bind the camera." }, "return": "encode result", "maixpy": "maix.video.Video.encode", - "py_doc": "Encode image.\n\nArgs:\n - img: the image will be encode.\nif the img is NULL, this function will try to get image from camera, you must use bind_camera to bind camera.\n\n\nReturns: encode result\n" + "py_doc": "Encode image.\n\nArgs:\n - img: the image will be encode.\nif the img is NULL, this function will try to get image from camera, you must use bind_camera() function to bind the camera.\n\n\nReturns: encode result\n" }, "args": [ [ "image::Image *", "img", - "NULL" + "maix::video::Video::NoneImage" ] ], - "ret_type": "video::Packet", + "ret_type": "video::Packet*", "static": false, - "def": "video::Packet encode(image::Image *img = NULL)", - "py_def": "def encode(self, img: maix.image.Image = 0) -> Packet" + "def": "video::Packet *encode(image::Image *img = maix::video::Video::NoneImage)", + "py_def": "def encode(self, img: maix.image.Image = ...) -> Packet" }, "decode": { "type": "func", @@ -18086,13 +19368,13 @@ [ "video::Frame *", "frame", - "NULL" + "nullptr" ] ], "ret_type": "image::Image*", "static": false, - "def": "image::Image *decode(video::Frame *frame = NULL)", - "py_def": "def decode(self, frame: Frame = 0) -> maix.image.Image" + "def": "image::Image *decode(video::Frame *frame = nullptr)", + "py_def": "def decode(self, frame: Frame = None) -> maix.image.Image" }, "finish": { "type": "func", @@ -18109,6 +19391,22 @@ "def": "err::Err finish()", "py_def": "def finish(self) -> maix.err.Err" }, + "capture": { + "type": "func", + "name": "capture", + "doc": { + "brief": "Capture image", + "attention": "Each time encode is called, the last captured image will be released.", + "return": "error code", + "maixpy": "maix.video.Video.capture", + "py_doc": "Capture image\n\nReturns: error code\n" + }, + "args": [], + "ret_type": "image::Image*", + "static": false, + "def": "image::Image *capture()", + "py_def": "def capture(self) -> maix.image.Image" + }, "is_recording": { "type": "func", "name": "is_recording", diff --git a/maixpy/api/index.html b/maixpy/api/index.html index a9b507d4..66db8eeb 100644 --- a/maixpy/api/index.html +++ b/maixpy/api/index.html @@ -122,9 +122,11 @@

MaixPy

+ + @@ -270,10 +273,18 @@

MaixPy API -- Maix AI machine vision platform Python API

maix.nn maix.nn module + + maix.audio + maix.audio module + maix.peripheral Chip's peripheral driver + + maix.rtmp + maix.rtmp module + maix.rtsp maix.rtsp module diff --git a/maixpy/api/maix/app.html b/maixpy/api/maix/app.html index 6d762b8d..c492c8c1 100644 --- a/maixpy/api/maix/app.html +++ b/maixpy/api/maix/app.html @@ -122,9 +122,11 @@

MaixPy

+ + diff --git a/maixpy/api/maix/audio.html b/maixpy/api/maix/audio.html new file mode 100644 index 00000000..0cccbd50 --- /dev/null +++ b/maixpy/api/maix/audio.html @@ -0,0 +1,797 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + maix.audio - MaixPy + + + + + + + + + + +
+ +
+ +
+
+
+
+ +

maix.audio

+ +
+
+
    + +
+
+
+
+ + +
+
+ + + +
+
+
+
+ + +
+
+ +
+
+ +

maix.audio module

+
+

You can use maix.audio to access this module with MaixPy
+This module is generated from MaixCDK

+
+

Module

+

No module

+

Enum

+

Format

+ + + + + + + + + + + + + + + + + +
itemdoc
briefAudio type
valuesFMT_NONE: format invalid
FMT_S8: unsigned 8 bits
FMT_S16_LE: signed 16 bits, little endian
FMT_S32_LE: signed 32 bits, little endian
FMT_S16_BE: signed 16 bits, big endian
FMT_S32_BE: signed 32 bits, big endian
FMT_U8: unsigned 8 bits
FMT_U16_LE: unsigned 16 bits, little endian
FMT_U32_LE: unsigned 32 bits, little endian
FMT_U16_BE: unsigned 16 bits, big endian
FMT_U32_BE: unsigned 32 bits, big endian
+

C++ defination code:

+ +
enum Format
+    {
+        FMT_NONE = 0,       // format invalid
+        FMT_S8,             // unsigned 8 bits
+        FMT_S16_LE,         // signed 16 bits, little endian
+        FMT_S32_LE,         // signed 32 bits, little endian
+        FMT_S16_BE,         // signed 16 bits, big endian
+        FMT_S32_BE,         // signed 32 bits, big endian
+        FMT_U8,             // unsigned 8 bits
+        FMT_U16_LE,         // unsigned 16 bits, little endian
+        FMT_U32_LE,         // unsigned 32 bits, little endian
+        FMT_U16_BE,         // unsigned 16 bits, big endian
+        FMT_U32_BE,         // unsigned 32 bits, big endian
+    }
+
+

Variable

+

Function

+

Class

+

Recorder

+ + + + + + + + + + + + + +
itemdoc
briefRecorder class
+

C++ defination code:

+ +
class Recorder
+
+

__init__

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefConstruct a new Recorder object
parampath: record path. the path determines the location where you save the file, if path is none, the audio module will not save file.
sample_rate: record sample rate, default is 48000(48KHz), means 48000 samples per second.
format: record sample format, default is audio::Format::FMT_S16_LE, means sampling 16 bits at a time and save as signed 16 bits, little endian. see @audio::Format
channel: record sample channel, default is 1, means 1 channel sampling at the same time
staticFalse
+

C++ defination code:

+ +
Recorder(std::string path = std::string(), int sample_rate = 48000, audio::Format format = audio::Format::FMT_S16_LE, int channel = 1)
+
+

volume

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefSet/Get record volume
paramvalue: volume value, If you use this parameter, audio will set the value to volume,
if you don't, it will return the current volume.
returnthe current volume
staticFalse
+

C++ defination code:

+ +
int volume(int value = -1)
+
+

record

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefRecord, Read all cached data in buffer and return.
paramrecord_ms: record time. unit: ms
sample_rate: audio sample rate
format: audio sample format
channel: audio sample channel
returnpcm data. datatype @see Bytes. If you pass in record_ms parameter, the return value is an empty Bytes object.
staticFalse
+

C++ defination code:

+ +
maix::Bytes *record(int record_ms = -1)
+
+

finish

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefFinish the record, if you have passed in the path, this api will save the audio data to file.
returnerror code, err::ERR_NONE means success, others means failed
staticFalse
+

C++ defination code:

+ +
err::Err finish()
+
+

sample_rate

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefGet sample rate
returnreturns sample rate
staticFalse
+

C++ defination code:

+ +
int sample_rate()
+
+

format

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefGet sample format
returnreturns sample format
staticFalse
+

C++ defination code:

+ +
audio::Format format()
+
+

channel

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefGet sample channel
returnreturns sample channel
staticFalse
+

C++ defination code:

+ +
int channel()
+
+

Player

+ + + + + + + + + + + + + +
itemdoc
briefPlayer class
+

C++ defination code:

+ +
class Player
+
+

__init__

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefConstruct a new Player object
parampath: player path. the path determines the location where you save the file, if path is none, the audio module will not save file.
sample_rate: player sample rate, default is 48000(48KHz), means 48000 samples per second.
format: player sample format, default is audio::Format::FMT_S16_LE, means sampling 16 bits at a time and save as signed 16 bits, little endian. see @audio::Format
channel: player sample channel, default is 1, means 1 channel sampling at the same time
staticFalse
+

C++ defination code:

+ +
Player(std::string path = std::string(), int sample_rate = 48000, audio::Format format = audio::Format::FMT_S16_LE, int channel = 1)
+
+

volume

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefSet/Get player volume(Not support now)
paramvalue: volume value, If you use this parameter, audio will set the value to volume,
if you don't, it will return the current volume.
returnthe current volume
staticFalse
+

C++ defination code:

+ +
int volume(int value = -1)
+
+

play

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefPlay
paramdata: audio data, must be raw data
returnerror code, err::ERR_NONE means success, others means failed
staticFalse
+

C++ defination code:

+ +
err::Err play(maix::Bytes *data = maix::audio::Player::NoneBytes)
+
+

sample_rate

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefGet sample rate
returnreturns sample rate
staticFalse
+

C++ defination code:

+ +
int sample_rate()
+
+

format

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefGet sample format
returnreturns sample format
staticFalse
+

C++ defination code:

+ +
audio::Format format()
+
+

channel

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefGet sample channel
returnreturns sample channel
staticFalse
+

C++ defination code:

+ +
int channel()
+
+ + +
+
+
+ + +
+
+
+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maixpy/api/maix/camera.html b/maixpy/api/maix/camera.html index 3e06fdb9..c34e00a0 100644 --- a/maixpy/api/maix/camera.html +++ b/maixpy/api/maix/camera.html @@ -122,9 +122,11 @@

MaixPy

+ + @@ -1278,6 +1281,90 @@

saturation

C++ defination code:

uint32_t saturation(uint32_t value = -1)
+
+

awb_mode

+ +
def awb_mode(self, value: int = -1) -> int
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefSet/Get white balance mode
attentionThis method will affect the isp and thus the image, so please be careful with it.
paramvalue: value = 0, means set white balance to auto mode, value = 1, means set white balance to manual mode, default is auto mode.
returnreturns awb mode
staticFalse
+

C++ defination code:

+ +
uint32_t awb_mode(uint32_t value = -1)
+
+

exp_mode

+ +
def exp_mode(self, value: int = -1) -> int
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefSet/Get exposure mode
attentionThis method will affect the isp and thus the image, so please be careful with it.
paramvalue: value = 0, means set exposure to auto mode, value = 1, means set exposure to manual mode, default is auto mode.
returnreturns exposure mode
staticFalse
+

C++ defination code:

+ +
uint32_t exp_mode(uint32_t value = -1)
 
diff --git a/maixpy/api/maix/comm.html b/maixpy/api/maix/comm.html index a2138c6b..bd5616bf 100644 --- a/maixpy/api/maix/comm.html +++ b/maixpy/api/maix/comm.html @@ -122,9 +122,11 @@

MaixPy

+ + diff --git a/maixpy/api/maix/display.html b/maixpy/api/maix/display.html index 649a7386..f31519b9 100644 --- a/maixpy/api/maix/display.html +++ b/maixpy/api/maix/display.html @@ -122,9 +122,11 @@

MaixPy

+ + diff --git a/maixpy/api/maix/err.html b/maixpy/api/maix/err.html index 89a73f3b..18a19659 100644 --- a/maixpy/api/maix/err.html +++ b/maixpy/api/maix/err.html @@ -122,9 +122,11 @@

MaixPy

+ + diff --git a/maixpy/api/maix/example.html b/maixpy/api/maix/example.html index 7cbbdd55..b24a83a5 100644 --- a/maixpy/api/maix/example.html +++ b/maixpy/api/maix/example.html @@ -122,9 +122,11 @@

MaixPy

+ + diff --git a/maixpy/api/maix/fs.html b/maixpy/api/maix/fs.html index b51ba236..6bc69f22 100644 --- a/maixpy/api/maix/fs.html +++ b/maixpy/api/maix/fs.html @@ -122,9 +122,11 @@

MaixPy

+ + diff --git a/maixpy/api/maix/i18n.html b/maixpy/api/maix/i18n.html index 9238d2e6..8a7e534c 100644 --- a/maixpy/api/maix/i18n.html +++ b/maixpy/api/maix/i18n.html @@ -122,9 +122,11 @@

MaixPy

+ + diff --git a/maixpy/api/maix/image.html b/maixpy/api/maix/image.html index ae77f1e0..59f602de 100644 --- a/maixpy/api/maix/image.html +++ b/maixpy/api/maix/image.html @@ -122,9 +122,11 @@

MaixPy

+ + @@ -7804,6 +7807,45 @@

to_format

image::Image *to_format(const image::Format &format)
 
+

to_jpeg

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefConvert image to jpeg
paramquality: the quality of jpg, default is 95. range is (50, 100].
returnnew image object. Need be delete by caller in C++.
throwerr.Exception, if two images' format not support, or already the format, will raise exception
staticFalse
+

C++ defination code:

+ +
image::Image *to_jpeg(int quality = 95)
+

draw_image

@@ -8135,7 +8177,7 @@

draw_keypoints

- + @@ -8149,7 +8191,7 @@

draw_keypoints

paramkeypoints: keypoints, [x, y, rotation_andle_in_degrees], TODO: rotation_andle_in_degrees support in the feature
color: keypoints color @see image::Color
size: size of keypoints
thickness: keypoints thickness(line width), by default(value is 1)
fill: if true, will fill keypoints, by default(value is false)
keypoints: keypoints, [x1, y1, x2, y2...] or [x, y, rotation_andle_in_degrees, x2, y2, rotation_andle_in_degrees2](TODO: rotation_andle_in_degrees support in the feature)
color: keypoints color @see image::Color
size: size of keypoints
thickness: keypoints thickness(line width), by default(value is -1 means fill circle)
return

C++ defination code:

-
image::Image *draw_keypoints(std::vector<int> keypoints, const image::Color &color, int size = 10, int thickness = 1, bool fill = false)
+
image::Image *draw_keypoints(std::vector<int> keypoints, const image::Color &color, int size = 10, int thickness = -1)
 

resize

@@ -8409,7 +8451,7 @@

compress

- + diff --git a/maixpy/api/maix/network.html b/maixpy/api/maix/network.html index b53b32dc..70364db8 100644 --- a/maixpy/api/maix/network.html +++ b/maixpy/api/maix/network.html @@ -122,9 +122,11 @@

MaixPy

+ + diff --git a/maixpy/api/maix/network/wifi.html b/maixpy/api/maix/network/wifi.html index 693bd5d6..0008015d 100644 --- a/maixpy/api/maix/network/wifi.html +++ b/maixpy/api/maix/network/wifi.html @@ -122,9 +122,11 @@

MaixPy

+ + diff --git a/maixpy/api/maix/nn.html b/maixpy/api/maix/nn.html index 023785c0..2400c343 100644 --- a/maixpy/api/maix/nn.html +++ b/maixpy/api/maix/nn.html @@ -122,9 +122,11 @@

MaixPy

+ + @@ -305,6 +308,9 @@

load

err::Err load(const string &model)
 

detect

+ +
def detect(self, img: maix.image.Image, conf_th: float = 0.5, iou_th: float = 0.45, fit: maix.image.Fit = ...) -> list[...]
+
briefJPEG compresses the image in place.JPEG compresses the image in place, the same as to_jpeg functioin, it's recommend to use to_jpeg instead.
param
@@ -1123,9 +1129,6 @@

MUD

class MUD
 

__init__

- -
def __init__(self, model_path: str = None) -> None
-
@@ -1276,6 +1279,9 @@

LayerInfo

class LayerInfo
 

__init__

+ +
def __init__(self, name: str = '', dtype: maix.tensor.DType = ..., shape: list[int] = []) -> None
+
@@ -1404,6 +1410,9 @@

shape

std::vector<int> shape
 

to_str

+ +
def to_str(self) -> str
+
@@ -1480,6 +1489,9 @@

NN

class NN
 

__init__

+ +
def __init__(self, model: str = '') -> None
+
@@ -1549,6 +1561,9 @@

load

err::Err load(const std::string &model)
 

loaded

+ +
def loaded(self) -> bool
+
@@ -1580,6 +1595,9 @@

loaded

bool loaded()
 

inputs_info

+ +
def inputs_info(self) -> list[LayerInfo]
+
@@ -1611,6 +1629,9 @@

inputs_info

std::vector<nn::LayerInfo> inputs_info()
 

outputs_info

+ +
def outputs_info(self) -> list[LayerInfo]
+
@@ -1642,6 +1663,9 @@

outputs_info

std::vector<nn::LayerInfo> outputs_info()
 

extra_info

+ +
def extra_info(self) -> dict[str, str]
+
@@ -1673,6 +1697,9 @@

extra_info

std::map<std::string, std::string> extra_info()
 

forward

+ +
def forward(self, inputs: maix.tensor.Tensors) -> maix.tensor.Tensors
+
@@ -1708,6 +1735,9 @@

forward

tensor::Tensors *forward(tensor::Tensors &inputs)
 

forward_image

+ +
def forward_image(self, img: maix.image.Image, mean: list[float] = [], scale: list[float] = [], fit: maix.image.Fit = ..., copy_result: bool = True) -> maix.tensor.Tensors
+
@@ -1742,7 +1772,7 @@

forward_image

tensor::Tensors *forward_image(image::Image &img, std::vector<float> mean = std::vector<float>(), std::vector<float> scale = std::vector<float>(), image::Fit fit = image::Fit::FIT_FILL, bool copy_result = true)
 
-

Object

+

FaceDetector

@@ -1753,13 +1783,13 @@

Object

- +
briefObject for detect resultFaceDetector class

C++ defination code:

-
class Object
+
class FaceDetector
 

__init__

@@ -1776,11 +1806,15 @@

__init__

- + - + + + + + @@ -1790,9 +1824,12 @@

__init__

briefConstructor of Object for detect resultConstructor of FaceDetector class
paramx: left top x
y: left top y
w: width
h: height
class_id: class id
score: score
model: model path, default empty, you can load model later by load function.
throwIf model arg is not empty and load failed, will throw err::Exception.
static

C++ defination code:

-
Object(int x = 0, int y = 0, int w = 0, int h = 0, int class_id = 0, float score = 0)
+
FaceDetector(const string &model = "")
+
+

load

+ +
def load(self, model: str) -> maix.err.Err
 
-

__str__

@@ -1807,11 +1844,15 @@

__str__

- + + + + + - + @@ -1821,9 +1862,12 @@

__str__

briefObject info to stringLoad model from file
parammodel: Model path want to load
returnObject info stringerr::Err
static

C++ defination code:

-
std::string to_str()
+
err::Err load(const string &model)
+
+

detect

+ +
def detect(self, img: maix.image.Image, conf_th: float = 0.5, iou_th: float = 0.45, fit: maix.image.Fit = ...) -> list[...]
 
-

x

@@ -1834,27 +1878,38 @@

x

- + - + - - + + - + + + + + + + + +
typevarfunc
briefObject left top coordinate xDetect objects from image
staticFalseparamimg: Image want to detect, if image's size not match model input's, will auto resize with fit method.
conf_th: Confidence threshold, default 0.5.
iou_th: IoU threshold, default 0.45.
fit: Resize method, default image.Fit.FIT_CONTAIN.
readonlythrowIf image format not match model input format, will throw err::Exception.
returnObject list. In C++, you should delete it after use.
static False

C++ defination code:

-
int x
+
std::vector<nn::Object> *detect(image::Image &img, float conf_th = 0.5, float iou_th = 0.45, maix::image::Fit fit = maix::image::FIT_CONTAIN)
+
+

input_size

+ +
def input_size(self) -> maix.image.Size
 
-

y

@@ -1865,27 +1920,64 @@

y

- + - + + + + + + +
typevarfunc
briefObject left top coordinate yGet model input size
returnmodel input size
static False
+

C++ defination code:

+ +
image::Size input_size()
+
+

input_width

+ +
def input_width(self) -> int
+
+ + + + + + + + - + + + + + + + + + + + + +
itemdoc
readonlytypefunc
briefGet model input width
returnmodel input size of width
static False

C++ defination code:

-
int y
+
int input_width()
+
+

input_height

+ +
def input_height(self) -> int
 
-

w

@@ -1896,27 +1988,61 @@

w

- + - + + + + + + +
typevarfunc
briefObject widthGet model input height
returnmodel input size of height
static False
+

C++ defination code:

+ +
int input_height()
+
+

input_format

+ +
def input_format(self) -> maix.image.Format
+
+ + + + + + + + - + + + + + + + + + + + + +
itemdoc
readonlytypefunc
briefGet input image format
returninput image format, image::Format type.
static False

C++ defination code:

-
int w
+
image::Format input_format()
 
-

h

+

mean

@@ -1931,7 +2057,7 @@

h

- + @@ -1945,9 +2071,9 @@

h

briefObject heightGet mean value, list type
static

C++ defination code:

-
int h
+
std::vector<float> mean
 
-

class_id

+

scale

@@ -1962,7 +2088,7 @@

class_id

- + @@ -1976,9 +2102,28 @@

class_id

briefObject class idGet scale value, list type
static

C++ defination code:

-
int class_id
+
std::vector<float> scale
 
-

score

+

Retinaface

+ + + + + + + + + + + + + +
itemdoc
briefRetinaface class
+

C++ defination code:

+ +
class Retinaface
+
+

__init__

@@ -1989,25 +2134,909 @@

score

- + - + + + + + + + + + + +
typevarfunc
briefObject scoreConstructor of Retinaface class
parammodel: model path, default empty, you can load model later by load function.
throwIf model arg is not empty and load failed, will throw err::Exception.
static False
+

C++ defination code:

+ +
Retinaface(const string &model = "")
+
+

load

+ +
def load(self, model: str) -> maix.err.Err
+
+ + - + + + + + + + + + + + + + + + + + + + + + + +
readonlyitemdoc
typefunc
briefLoad model from file
parammodel: Model path want to load
returnerr::Err
static False

C++ defination code:

-
float score
+
err::Err load(const string &model)
+
+

detect

+ +
def detect(self, img: maix.image.Image, conf_th: float = 0.5, iou_th: float = 0.45, fit: maix.image.Fit = ...) -> list[...]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefDetect objects from image
paramimg: Image want to detect, if image's size not match model input's, will auto resize with fit method.
conf_th: Confidence threshold, default 0.4.
iou_th: IoU threshold, default 0.45.
fit: Resize method, default image.Fit.FIT_CONTAIN.
throwIf image format not match model input format, will throw err::Exception.
returnObject list. In C++, you should delete it after use.
staticFalse
+

C++ defination code:

+ +
std::vector<nn::Object> *detect(image::Image &img, float conf_th = 0.4, float iou_th = 0.45, maix::image::Fit fit = maix::image::FIT_CONTAIN)
+
+

input_size

+ +
def input_size(self) -> maix.image.Size
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefGet model input size
returnmodel input size
staticFalse
+

C++ defination code:

+ +
image::Size input_size()
+
+

input_width

+ +
def input_width(self) -> int
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefGet model input width
returnmodel input size of width
staticFalse
+

C++ defination code:

+ +
int input_width()
+
+

input_height

+ +
def input_height(self) -> int
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefGet model input height
returnmodel input size of height
staticFalse
+

C++ defination code:

+ +
int input_height()
+
+

input_format

+ +
def input_format(self) -> maix.image.Format
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefGet input image format
returninput image format, image::Format type.
staticFalse
+

C++ defination code:

+ +
image::Format input_format()
+
+

mean

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefGet mean value, list type
staticFalse
readonlyFalse
+

C++ defination code:

+ +
std::vector<float> mean
+
+

scale

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefGet scale value, list type
staticFalse
readonlyFalse
+

C++ defination code:

+ +
std::vector<float> scale
+
+

Object

+ + + + + + + + + + + + + +
itemdoc
briefObject for detect result
+

C++ defination code:

+ +
class Object
+
+

__init__

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefConstructor of Object for detect result
paramx: left top x
y: left top y
w: width
h: height
class_id: class id
score: score
staticFalse
+

C++ defination code:

+ +
Object(int x = 0, int y = 0, int w = 0, int h = 0, int class_id = 0, float score = 0, std::vector<int> points = std::vector<int>())
+
+

__str__

+ +
def to_str(self) -> str
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefObject info to string
returnObject info string
staticFalse
+

C++ defination code:

+ +
std::string to_str()
+
+

x

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject left top coordinate x
staticFalse
readonlyFalse
+

C++ defination code:

+ +
int x
+
+

y

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject left top coordinate y
staticFalse
readonlyFalse
+

C++ defination code:

+ +
int y
+
+

w

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject width
staticFalse
readonlyFalse
+

C++ defination code:

+ +
int w
+
+

h

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject height
staticFalse
readonlyFalse
+

C++ defination code:

+ +
int h
+
+

class_id

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject class id
staticFalse
readonlyFalse
+

C++ defination code:

+ +
int class_id
+
+

score

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject score
staticFalse
readonlyFalse
+

C++ defination code:

+ +
float score
+
+

points

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefkeypoints
staticFalse
readonlyFalse
+

C++ defination code:

+ +
std::vector<int> points
+
+

ObjectFloat

+ + + + + + + + + + + + + +
itemdoc
briefObject for detect result
+

C++ defination code:

+ +
class ObjectFloat
+
+

__init__

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefConstructor of Object for detect result
paramx: left top x
y: left top y
w: width
h: height
class_id: class id
score: score
staticFalse
+

C++ defination code:

+ +
ObjectFloat(float x = 0, float y = 0, float w = 0, float h = 0, float class_id = 0, float score = 0, std::vector<float> points = std::vector<float>())
+
+

__str__

+ +
def to_str(self) -> str
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typefunc
briefObject info to string
returnObject info string
staticFalse
+

C++ defination code:

+ +
std::string to_str()
+
+

x

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject left top coordinate x
staticFalse
readonlyFalse
+

C++ defination code:

+ +
float x
+
+

y

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject left top coordinate y
staticFalse
readonlyFalse
+

C++ defination code:

+ +
float y
+
+

w

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject width
staticFalse
readonlyFalse
+

C++ defination code:

+ +
float w
+
+

h

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject height
staticFalse
readonlyFalse
+

C++ defination code:

+ +
float h
+
+

class_id

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject class id
staticFalse
readonlyFalse
+

C++ defination code:

+ +
float class_id
+
+

score

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefObject score
staticFalse
readonlyFalse
+

C++ defination code:

+ +
float score
+
+

points

+ + + + + + + + + + + + + + + + + + + + + + + + + +
itemdoc
typevar
briefkeypoints
staticFalse
readonlyFalse
+

C++ defination code:

+ +
std::vector<float> points
 
diff --git a/maixpy/api/maix/nn/F.html b/maixpy/api/maix/nn/F.html index c28691f5..56b9c29b 100644 --- a/maixpy/api/maix/nn/F.html +++ b/maixpy/api/maix/nn/F.html @@ -122,9 +122,11 @@

MaixPy

+ + @@ -248,8 +251,8 @@

Class

diff --git a/maixpy/doc/en/basic/maixpy_upgrade.html b/maixpy/doc/en/basic/maixpy_upgrade.html index 5020d936..7cf2073e 100644 --- a/maixpy/doc/en/basic/maixpy_upgrade.html +++ b/maixpy/doc/en/basic/maixpy_upgrade.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/basic/maixvision.html b/maixpy/doc/en/basic/maixvision.html index e51e16e9..5c8abf2f 100644 --- a/maixpy/doc/en/basic/maixvision.html +++ b/maixpy/doc/en/basic/maixvision.html @@ -44,7 +44,7 @@ - MaixVision - MaixPy Programming + Graphical Block Programming - MaixPy + MaixVision -- MaixPy Programming IDE + Graphical Block Programming - MaixPy @@ -102,7 +102,7 @@

MaixPy

@@ -175,7 +198,7 @@

MaixPy

-

MaixVision - MaixPy Programming + Graphical Block Programming

+

MaixVision -- MaixPy Programming IDE + Graphical Block Programming

@@ -211,13 +234,15 @@

MaixVision - MaixPy Programming + Graphical Block Programming

Introduction

-

MaixVision is a developer programming tool specifically designed for the Maix ecosystem, supporting MaixPy programming and graphical block programming. It also supports online running, debugging, and real-time image preview, allowing the synchronization of the device display screen for easy debugging and development.

-

It also supports packaging applications and installing them on devices, making it convenient for users to generate and install applications with a single click.

-

Additionally, it integrates some handy development tools, such as file management, threshold editors, QR code generators, and more.

+

MaixVision is a development tool specifically designed for the Maix ecosystem, supporting MaixPy programming and graphical block programming. It allows for online operation and debugging, real-time image preview, and synchronizing images from device displays, which is convenient for debugging and development.

+

It also supports packaging and installing applications on devices, allowing users to easily generate and install applications with one click.

+

In addition, it integrates several handy tools for development, such as file management, threshold editor, QR code generator, and more.

+

Download

+

Visit the MaixVision homepage to download.

Using MaixPy Programming and Online Running

-

By following the steps in the Quick Start, we can easily use MaixPy programming and run programs online.

+

Follow the steps in Quick Start to connect your device, and you can easily use MaixPy programming and run it online.

Real-time Image Preview

-

MaixPy provides a display module, which can display images on the screen. When calling the show method of the display module, the image will be sent to MaixVision for display in real-time, for example:

+

MaixPy provides a display module that can show images on the screen. Also, when the show method of the display module is called, it sends the image to be displayed on MaixVision, for example:

from maix import display, camera
 
@@ -226,42 +251,71 @@ 

Real-time Image Preview

while 1: disp.show(cam.read())
-

Here, we capture an image using the camera, and then display it on the screen using disp.show(), which will also transmit the image to MaixVision for display.

-

By clicking the Pause button in the top right corner, the transmission of the image to MaixVision display will stop.

-

Computing the Histogram of an Image

-

In the previous step, we could see the image in real-time on MaixVision. By selecting a region with the mouse, we can view the histogram of that area below the image. Choosing different color representation methods allows us to see histograms of different color channels. This feature helps us find suitable parameters when working on image processing algorithms.

-

Using Graphical Block Programming

-

Currently in development, stay tuned for updates.

+

Here we use the camera to capture an image, then display it on the screen using the disp.show() method, and also send it to MaixVision for display.

+

When we click the 'pause' button in the top right corner, it will stop sending images to MaixVision.

+

Code Auto Completion

+

Code suggestions depend on local Python packages installed on your computer. To enable code suggestions, you need to install Python on your computer and the required Python packages.

+
    +
  • To install Python, visit the Python official website.
  • +
  • To install the required packages, for MaixPy, for instance, you need to install the MaixPy package on your computer using pip install MaixPy. If MaixPy gets updated, you should update it on both your computer and device. On your computer, manually execute pip install MaixPy -U in the terminal. For device updates, update directly in the Settings application.
  • +
+
+

Users in China can use a local mirror pip install -i https://pypi.tuna.tsinghua.edu.cn/simple MaixPy.

+
+
    +
  • Restart MaixVision to see the code suggestions.
  • +
+
+

If suggestions still do not appear, you can manually set the path to the Python executable in settings and restart.

+
+
+

Note that installing Python packages on your computer is just for code suggestions. The actual code runs on the device (development board), and the device must also have the corresponding packages to run properly.

+
+
+

Additionally, while you have the MaixPy package installed on your computer, due to our limited resources, we cannot guarantee that you can directly use the Maix package in your computer's Python. Please run it on supported devices.

+
+

Calculating the Image Histogram

+

In the previous step, we could see the image in real-time in MaixVision. By selecting an area with the mouse, we can view the histogram for that area at the bottom of the screen, displaying different color channels.

+

This feature is helpful when finding suitable parameters for some image processing algorithms.

Distinguishing Between Device File System and Computer File System

-

An important concept to grasp here is distinguishing between the Computer File System and Device File System:

+

Here we have an important concept to grasp: distinguish between the Device File System and the Computer File System.

    -
  • Computer File System: This operates on the computer. Opening files or projects in MaixVision accesses files stored on the computer. Any changes are automatically saved to the computer's file system.
  • -
  • Device File System: When a program runs, it sends files to the device for execution. Therefore, files accessed within the code are read from the device's file system.
  • +
  • Computer File System: Operates on the computer. Opening a file or project in MaixVision accesses files on the computer, and saving is automatically done to the computer's file system.
  • +
  • Device File System: The program sends the code to the device for execution, so the files used in the code are read from the device's file system.
-

A common issue arises when a file is saved on the computer at D:\data\a.jpg, and then the file is referenced on the device like img = image.load("D:\data\a.jpg"). This file cannot be found on the device because there is no D:\data\a.jpg file stored there.

-

For specific instructions on transferring computer files to the device, please refer to the following section.

+

A common issue is when students save a file on the computer, such as D:\data\a.jpg, and then use this file on the device with img = image.load("D:\data\a.jpg"). Naturally, the file cannot be found because the device does not have D:\data\a.jpg.

+

For specifics on how to send files from the computer to the device, refer to the following section.

Transferring Files to the Device

-

Currently in development. In the meantime, you can use alternative tools:

-

Begin by knowing the device's IP address or device name, which MaixVision can search for, or check in the device's Settings -> System Information, where you might find something similar to maixcam-xxxx.local or 192.168.0.123. The username and password are both root, and the file transfer protocol is SFTP with port number 22.

-

There are various user-friendly software options available for different operating systems:

-

For Windows

-

Use tools like WinSCP or FileZilla to connect to the device via SFTP. Provide the necessary device and account information to establish the connection.

-

For further guidance, perform a quick online search.

-

For Linux

-

Use the scp command in the terminal to transfer files to the device, for example:

+

First, connect to the device, then click the button to browse the device file system, as shown below. Then you can upload files to the device or download files to the computer.

+

maixvision_browser2

+

maixvision_browser

+
+Alternatively, other tools can be used, click to expand +

First, know the device's IP address or name, which MaixVision can find, or see in the device's Settings->System Information, such as maixcam-xxxx.local or 192.168.0.123.
+ The username and password are root, using the SFTP protocol for file transfer, and the port number is 22.

+

There are many useful tools available for different systems:

+

Windows

+

Use WinSCP or FileZilla to connect to the device and transfer files, choosing the SFTP protocol and entering the device and account information to connect.

+

Specific instructions can be searched online.

+

Linux

+

In the terminal, use the scp command to transfer files to the device, such as:

scp /path/to/your/file.py root@maixcam-xxxx.local:/root
 
-

For Mac

+

Mac

    -
  • Method 1: Use the scp command in the terminal to transfer files to the device, for example:
  • +
  • Method 1: In the terminal, use the scp command to transfer files to the device, such as:
scp /path/to/your/file.py root@maixcam-xxxx.local:/root
 
    -
  • Method 2: Use tools like FileZilla to connect to the device, transfer the files to the device, choose the SFTP protocol, fill in the device and account information, and connect.
  • +
  • Method 2: Use FileZilla or other tools to connect to the device and transfer files, choosing the SFTP protocol and entering the device and account information to connect.
+
+
+

Using Graphical Block Programming

+

Under development, please stay tuned.

diff --git a/maixpy/doc/en/basic/os.html b/maixpy/doc/en/basic/os.html index d022990f..24e88013 100644 --- a/maixpy/doc/en/basic/os.html +++ b/maixpy/doc/en/basic/os.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/basic/python.html b/maixpy/doc/en/basic/python.html index 917c011a..db219d04 100644 --- a/maixpy/doc/en/basic/python.html +++ b/maixpy/doc/en/basic/python.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/basic/python_pkgs.html b/maixpy/doc/en/basic/python_pkgs.html index 145fb63a..cdfbec93 100644 --- a/maixpy/doc/en/basic/python_pkgs.html +++ b/maixpy/doc/en/basic/python_pkgs.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/faq.html b/maixpy/doc/en/faq.html index c9b45e20..b756927f 100644 --- a/maixpy/doc/en/faq.html +++ b/maixpy/doc/en/faq.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/index.html b/maixpy/doc/en/index.html index 34b199e7..8fb09a2e 100644 --- a/maixpy/doc/en/index.html +++ b/maixpy/doc/en/index.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/modules/acc.html b/maixpy/doc/en/modules/acc.html index d6a75d24..ac1308c4 100644 --- a/maixpy/doc/en/modules/acc.html +++ b/maixpy/doc/en/modules/acc.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/modules/thermal_cam.html b/maixpy/doc/en/modules/thermal_cam.html index 3145ee4d..2c076aa6 100644 --- a/maixpy/doc/en/modules/thermal_cam.html +++ b/maixpy/doc/en/modules/thermal_cam.html @@ -102,7 +102,7 @@

MaixPy

@@ -229,8 +252,8 @@

diff --git a/maixpy/doc/en/no_translate.html b/maixpy/doc/en/no_translate.html index 7820a3fd..9d41eaf6 100644 --- a/maixpy/doc/en/no_translate.html +++ b/maixpy/doc/en/no_translate.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/peripheral/gpio.html b/maixpy/doc/en/peripheral/gpio.html index 52e81607..b39bb669 100644 --- a/maixpy/doc/en/peripheral/gpio.html +++ b/maixpy/doc/en/peripheral/gpio.html @@ -44,7 +44,7 @@ - MaixPy + MaixPy Using GPIO - MaixPy @@ -102,7 +102,7 @@

MaixPy

@@ -175,7 +198,7 @@

MaixPy

-

+

MaixPy Using GPIO

@@ -189,8 +212,8 @@

-
@@ -214,7 +237,41 @@

- +

Introduction

+

Using GPIO allows you to control pins for input or output high and low levels, which is commonly used to read signals or output control signals.

+

Using GPIO in MaixPy

+
+

MaixPy Firmware should > 4.1.2(not include)

+
+

First, we need to know which pins and GPIOs the device has. For MaixCAM, each pin corresponds to a GPIO controller, as shown in the figure:

+

+

It is important to note that pins can be used not only as GPIOs but also for other functions like PWM. Before using them, we need to set the pin function to GPIO.

+

For example, on MaixCAM, some pins are already occupied by other functions by default, such as UART0 and WiFi (SDIO1 + A26), so it is not recommended to use them. Other pins can be used, and the A14 pin is connected to the onboard LED, which is used as a system load indicator by default. If initialized, it will automatically disable the system indicator function and can be used as a regular GPIO (note that A14 can only be used as an output). This way, you can control the LED's on and off state.

+ +
from maix import gpio, pinmap, time
+
+pinmap.set_pin_function("A14", "GPIOA14")
+led = gpio.GPIO("A14", gpio.Mode.OUT)
+led.value(0)
+
+while 1:
+    led.toggle()
+    time.sleep_ms(500)
+
+

Here, we first use pinmap to set the function of the A14 pin to GPIO. Of course, for A14, since it only has the GPIO function, it can be omitted. For the sake of generality, other pins may need to be set, so it is set in this example.

+

For more APIs, please refer to the GPIO API Documentation

+

GPIO in Input Mode

+ +
from maix import gpio, pinmap, time
+
+pinmap.set_pin_function("A19", "GPIOA19")
+led = gpio.GPIO("A19", gpio.Mode.IN)
+
+while 1:
+    print(led.value())
+    time.sleep_ms(1) # sleep to make cpu free
+
+
diff --git a/maixpy/doc/en/peripheral/i2c.html b/maixpy/doc/en/peripheral/i2c.html index 5717f293..eb2b10fd 100644 --- a/maixpy/doc/en/peripheral/i2c.html +++ b/maixpy/doc/en/peripheral/i2c.html @@ -44,10 +44,10 @@ - MaixPy + MaixPy Using I2C - MaixPy - + @@ -102,7 +102,7 @@

MaixPy

@@ -175,7 +198,7 @@

MaixPy

-

+

MaixPy Using I2C

@@ -189,10 +212,6 @@

- -
@@ -214,7 +233,42 @@

- +

For MaixCAM, due to the tight pin resource constraints, the I2C pins overlap with the WiFi module (SDIO1), so you can only use either WiFi or hardware I2C, but not both.

+

Therefore, it is recommended to use IO emulation for I2C.

+
+

Note: Requires MaixPy image and firmware > 4.1.2 (not included)

+
+

IO Emulation I2C

+

To emulate I2C, you only need to use the GPIO functionality for the pins. On MaixCAM, the emulated I2C is fixed to pins A15 (SCL) and A27 (SDA), with the i2c number being 5. To use it, simply:

+ +
from maix import i2c, pinmap
+
+# pinmap.set_pin_function("A15", "GPIOA23")
+# pinmap.set_pin_function("A27", "GPIOA24")
+
+bus1 = i2c.I2C(5, i2c.Mode.MASTER)
+slaves = bus1.scan()
+print("find slaves:", slaves)
+
+

More API visit i2c API doc

+

Hardware I2C

+

As mentioned above, for MaixCAM, hardware I2C and WiFi are mutually exclusive. If you must use hardware I2C, you need to disable WiFi and use the pinmap module to set the pin functions to I2C, then use the maix.i2c module to operate.

+
+

TODO: Provide a method to disable WiFi (requires disabling the WiFi driver in the system, which is relatively complex)

+
+

Hardware I2C and its correspond pin see:

+

+ +
from maix import i2c, pinmap
+
+pinmap.set_pin_function("P18", "I2C1_SCL")
+pinmap.set_pin_function("P21", "I2C1_SDA")
+
+bus1 = i2c.I2C(1, i2c.Mode.MASTER)
+slaves = bus1.scan()
+print("find slaves:", slaves)
+
+
diff --git a/maixpy/doc/en/peripheral/pwm.html b/maixpy/doc/en/peripheral/pwm.html index 86ef178c..8ad748af 100644 --- a/maixpy/doc/en/peripheral/pwm.html +++ b/maixpy/doc/en/peripheral/pwm.html @@ -44,7 +44,7 @@ - MaixPy + Using PWM in MaixPy - MaixPy @@ -102,7 +102,7 @@

MaixPy

@@ -175,7 +198,7 @@

MaixPy

-

+

Using PWM in MaixPy

@@ -189,8 +212,8 @@

-
@@ -214,7 +237,44 @@

- +

Introduction

+

To use PWM in MaixPy (v4), first set the pin function to PWM using pinmap.

+

Each PWM corresponds to a specific pin, as shown in the pin diagram of MaixCAM:

+

+

We recommend using PWM6 and PWM7.

+

For MaixCAM, since WiFi uses all pins of SDIO1, PWM4~9 can only be used alternatively with WiFi.

+
+

TODO: Provide a method to disable WiFi (requires disabling the WiFi driver in the system, which is quite complex)

+
+

Using PWM to Control a Servo in MaixPy

+

Here we take controlling a servo as an example, using PWM7 and the A19 pin of MaixCAM:

+ +
from maix import pwm, time, pinmap
+
+SERVO_PERIOD = 50     # 50Hz 20ms
+SERVO_MIN_DUTY = 2.5  # 2.5% -> 0.5ms
+SERVO_MAX_DUTY = 12.5  # 12.5% -> 2.5ms
+
+# Use PWM7
+pwm_id = 7
+# !! set pinmap to use PWM7
+pinmap.set_pin_function("A19", "PWM7")
+
+def angle_to_duty(percent):
+    return (SERVO_MAX_DUTY - SERVO_MIN_DUTY) * percent / 100.0 + SERVO_MIN_DUTY
+
+out = pwm.PWM(pwm_id, freq=SERVO_PERIOD, duty=angle_to_duty(0), enable=True)
+
+for i in range(100):
+    out.duty(angle_to_duty(i))
+    time.sleep_ms(100)
+
+for i in range(100):
+    out.duty(angle_to_duty(100 - i))
+    time.sleep_ms(100)
+
+

This code controls the servo to rotate from the minimum angle to the maximum angle and then back to the minimum angle.

+
diff --git a/maixpy/doc/en/peripheral/spi.html b/maixpy/doc/en/peripheral/spi.html index baf5bb5e..22ced05a 100644 --- a/maixpy/doc/en/peripheral/spi.html +++ b/maixpy/doc/en/peripheral/spi.html @@ -44,10 +44,10 @@ - MaixPy + MaixPy ues SPI - MaixPy - + @@ -102,7 +102,7 @@

MaixPy

@@ -175,7 +198,7 @@

MaixPy

-

+

MaixPy ues SPI

@@ -189,10 +212,6 @@

- -
@@ -214,7 +233,8 @@

- +

TODO:

+
diff --git a/maixpy/doc/en/peripheral/uart.html b/maixpy/doc/en/peripheral/uart.html index 1ef8e5ba..61a8a065 100644 --- a/maixpy/doc/en/peripheral/uart.html +++ b/maixpy/doc/en/peripheral/uart.html @@ -44,7 +44,7 @@ - MaixPy + Introduction to Using UART in MaixPy - MaixPy @@ -102,7 +102,7 @@

MaixPy

@@ -175,7 +198,7 @@

MaixPy

-

+

Introduction to Using UART in MaixPy

@@ -189,8 +212,8 @@

-
@@ -214,7 +237,60 @@

- +

Introduction to UART

+

UART (Universal Asynchronous Receiver/Transmitter) is a communication method that includes definitions for both hardware and communication protocols.

+
    +
  • Hardware includes:

    +
      +
    • 3 pins: GND, RX, TX. The communication parties connect RX and TX in a cross configuration, i.e., the TX of one side is connected to the RX of the other side, and both GND pins are connected together.
    • +
    • Controller: Usually inside the chip, also known as a UART peripheral. A chip generally has one or more UART controllers, each with corresponding pins.
    • +
    +
  • +
  • Communication protocol: To ensure smooth communication between both parties, a set of protocols is defined. You can learn the specifics on your own. Common parameters include baud rate and parity bit, with baud rate being the most frequently used parameter.

    +
  • +
+

Using the board's UART, you can communicate with other microcontrollers or SoCs. For instance, you can implement a human detection function on MaixCAM and send the detected coordinates to an STM32 microcontroller via UART.

+

Using UART in MaixPy

+

For MaixCAM, a UART is by default exposed through the USB port. By connecting a Type-C adapter board, you can directly use the UART pins on it. Alternatively, you can use the A16 (TX) and A17 (RX) pins on the board directly, which are equivalent to the ones exposed through the USB port.

+

When using the UART exposed through the USB port on MaixCAM, note that the RX and TX pins on the Type-C adapter board will switch when you flip the Type-C connector. So, if communication fails, it might be due to reversed RX and TX. Try flipping the Type-C connector and check if the communication works properly. This is a design flaw, but it’s manageable with minimal adjustments.

+

After connecting the communicating boards (connecting RX to TX in a cross configuration and both GND pins together), you can use the software.

+

Using UART in MaixPy is simple:

+ +
from maix import uart
+
+devices = uart.list_devices()
+
+serial = uart.UART(devices[0], 115200)
+serial.write_str("hello world")
+print("received:", serial.read(timeout = 2000))
+
+

Here, we list all UART devices in the system and use the first one, which is the one exposed through the Type-C port.

+

For more UART APIs, please refer to the UART API Documentation

+

Other Usage and Using Additional UARTs

+ +
from maix import app, uart, pinmap, time
+import sys
+
+# pinmap.set_pin_function("A16", "UART0_TX")
+# pinmap.set_pin_function("A17", "UART0_RX")
+device = "/dev/ttyS0"
+
+serial0 = uart.UART(device, 115200)
+
+serial0.write("hello 1\r\n".encode())
+serial0.write_str("hello 2\r\n")
+
+while not app.need_exit():
+    data = serial0.read()
+    if data:
+        print("Received, type: {}, len: {}, data: {}".format(type(data), len(data), data))
+        serial0.write(data)
+    time.sleep_ms(1) # sleep 1ms to make CPU free
+
+

Here, we set up pin mapping, especially if you want to use UARTs other than UART0. Use pinmap.set_pin_function based on the pin numbers and UART in the diagram:

+

+

Additionally, a sleep_ms function is added in the loop to briefly release the CPU, ensuring that the program does not occupy the CPU fully. There are other methods to achieve this, but this is the simplest and most straightforward approach.

+
diff --git a/maixpy/doc/en/peripheral/wdt.html b/maixpy/doc/en/peripheral/wdt.html index c628f269..6a8fa7be 100644 --- a/maixpy/doc/en/peripheral/wdt.html +++ b/maixpy/doc/en/peripheral/wdt.html @@ -44,7 +44,7 @@ - MaixPy + Using Watchdog Timer in MaixPy - MaixPy @@ -102,7 +102,7 @@

MaixPy

@@ -175,7 +198,7 @@

MaixPy

-

+

Using Watchdog Timer in MaixPy

@@ -189,8 +212,8 @@

-
@@ -214,7 +237,23 @@

- +

Introduction

+

To prevent program issues, a watchdog timer (WDT) is often used to automatically restart the system when the program encounters a problem.

+

The principle is that there is a countdown timer that we need to periodically reset within the program logic (also called "feeding the dog"). If our program gets stuck and fails to reset the countdown timer, the hardware will trigger a system reboot when the timer reaches 0.

+

Using WDT in MaixPy

+ +
from maix import wdt, app, time
+
+w = wdt.WDT(0, 1000)
+
+while not app.need_exit():
+    w.feed()
+    # Here, sleep operation is our task
+    # 200 ms is normal; if it exceeds 1000 ms, it will cause a system reset
+    time.sleep_ms(200)
+
+

This code sets up a watchdog timer that requires feeding every 1000 ms. If the program fails to feed the watchdog within this period, the system will reset.

+
diff --git a/maixpy/doc/en/pro/compile_os.html b/maixpy/doc/en/pro/compile_os.html index 61be8f61..d0f38ac8 100644 --- a/maixpy/doc/en/pro/compile_os.html +++ b/maixpy/doc/en/pro/compile_os.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/projects/index.html b/maixpy/doc/en/projects/index.html new file mode 100644 index 00000000..72101ee4 --- /dev/null +++ b/maixpy/doc/en/projects/index.html @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Practical Projects with MaixPy, Introduction and Collection - MaixPy + + + + + + + + + + +
+ +
+ +
+
+
+
+ +

Practical Projects with MaixPy, Introduction and Collection

+ +
+
+
    + +
+
+
+
+ + +
+
+ + + +
+
+
+
+ + +
+
+ +
+
+ +

Introduction

+

Here we provide some common practical project examples for community members to refer to and replicate for use. This also helps to inspire everyone to create more and better applications and projects.

+

There are several ways to find projects implemented with MaixPy:

+

MaixPy Official Documentation

+

You can find practical projects in the documentation on the left, such as "Line Following Car."

+

If you have a good project or a recommended project, you can also contribute by adding it to the documentation.

+

MaixHub Project Sharing Square

+

Projects can be found in the MaixHub Project Sharing section.

+

High-quality shares will also be linked to the MaixPy official documentation.

+

You can also share your project-making methods, which will receive official rewards (guaranteed) and cash tips from community members (usually, high-quality projects that meet urgent needs are more likely to be tipped).

+

Recommend Projects:

+ +

MaixHub App Sharing

+

In addition to project sharing, you can also find directly runnable applications at the MaixHub App Store, some of which might be written in MaixPy. If the author has provided the source code or written detailed tutorials, these can also be referred to.

+

Recommend Projects:

+ + + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maixpy/doc/en/projects/line_tracking_robot.html b/maixpy/doc/en/projects/line_tracking_robot.html new file mode 100644 index 00000000..24cb277e --- /dev/null +++ b/maixpy/doc/en/projects/line_tracking_robot.html @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MaixPy Line Tracking Robot (/Car) - MaixPy + + + + + + + + + + +
+ +
+ +
+
+
+
+ +

MaixPy Line Tracking Robot (/Car)

+ +
+
+
    + +
+
+
+
+ + + + +
+
+ + + +
+
+
+
+ + +
+
+ + +
+ + Update history +
+ + + + + + + + + + + + + + + + + + + +
DateVersionAuthorUpdate content
2024-05-091.0.0lxowalle + + Initial documentation + +
+
+
+ +
+
+ +

Before reading this article, make sure you know how to develop with MaixCAM. For details, please read Quick Start.

+

Introduction

+

This article describes how to implement a line tracking robot using MaixPy.

+

How to implement line tracking robot using MaixPy

+
    +
  1. Preparation of MaixCAM and trolley
  2. +
  3. Implementing the line tracking function
  4. +
  5. Implement the trolley control function
  6. +
+

Preparation of MaixCAM and trolley

+

TODO

+

Implementing the line tracking function

+

You can quickly find straight lines using the get_regression of the image module, see [Line tracking](. /line_tracking.html).

+

Code:

+ +
from maix import camera, display, image
+
+cam = camera.Camera(320, 240)
+disp = display.Display()
+
+# thresholds = [[0, 80, 40, 80, 10, 80]]      # red
+thresholds = [[0, 80, -120, -10, 0, 30]]    # green
+# thresholds = [[0, 80, 30, 100, -120, -60]]  # blue
+
+while 1:
+    img = cam.read()
+
+    lines = img.get_regression(thresholds, area_threshold = 100)
+    for a in lines:
+        img.draw_line(a.x1(), a.y1(), a.x2(), a.y2(), image.COLOR_GREEN, 2)
+        theta = a.theta()
+        rho = a.rho()
+        if theta > 90:
+            theta = 270 - theta
+        else:
+            theta = 90 - theta
+        img.draw_string(0, 0, "theta: " + str(theta) + ", rho: " + str(rho), image.COLOR_BLUE)
+
+    disp.show(img)
+
+
+

The above code implements the function of finding a straight line, note:

+
    +
  • Use a.theta() to get the angle of the line.
  • +
  • Use a.rho() to get the distance between the line and the origin (the origin is in the upper left corner).
  • +
+

After find the straight line with reference to the above code, you can use a.theta() and a.rho() to control the direction of the cart.

+

Implement the trolley control function

+

TODO

+ + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maixpy/doc/en/sidebar.yaml b/maixpy/doc/en/sidebar.yaml index dabc8295..5751da37 100644 --- a/maixpy/doc/en/sidebar.yaml +++ b/maixpy/doc/en/sidebar.yaml @@ -2,126 +2,146 @@ items: - file: README.md label: Quick Start - file: faq.md - label: FAQ + label: FAQ - label: Base -- file: basic/os.md - label: Burning system -- file: basic/app_usage.md - label: App uses -- file: basic/maixpy_upgrade.md - label: Update MaixPy -- file: basic/maixvision.md - label: MaixVision uses -- file: basic/python.md - label: Python syntax -- file: basic/linux_basic.md - label: Linux fundamentals -- file: basic/python_pkgs.md - label: Add python packages -- file: basic/app.md - label: Apps development + collapsed: false + items: + - file: basic/os.md + label: Burning system + - file: basic/app_usage.md + label: App uses + - file: basic/maixpy_upgrade.md + label: Update MaixPy + - file: basic/maixvision.md + label: MaixVision uses + - file: basic/python.md + label: Python syntax + - file: basic/linux_basic.md + label: Linux fundamentals + - file: basic/python_pkgs.md + label: Add python packages + - file: basic/app.md + label: Apps development - label: Basic images and algorithms -- file: vision/display.md - label: Screen uses -- file: vision/camera.md - label: Camera uses -- file: vision/image_ops.md - label: Image control -- file: vision/find_blobs.md - label: Finding color blocks -- file: vision/qrcode.md - label: QRcode identity -- file: vision/apriltag.md - label: AprilTag identity + items: + - file: vision/display.md + label: Screen uses + - file: vision/camera.md + label: Camera uses + - file: vision/image_ops.md + label: Image control + - file: vision/find_blobs.md + label: Finding color blocks + - file: vision/line_tracking.md + label: Line tracking + - file: vision/qrcode.md + label: QRcode identity + - file: vision/apriltag.md + label: AprilTag identity - label: AI Vision -- file: vision/ai.md - label: AI vision knowledge -- file: vision/classify.md - label: AI object classify -- file: vision/yolov5.md - label: YOLOv5 object detect -- file: vision/face_recognition.md - label: Face detect -- file: vision/body_key_points.md - label: Human critical point detection -- file: vision/self_learn_classifier.md - label: Self-learning classifier -- file: vision/self_learn_detector.md - label: Self-learning detector -- file: vision/object_track.md - label: Object tracking and counting -- file: vision/ocr.md - label: OCR -- file: vision/maixhub_train.md - label: MaixHub online AI training -- file: vision/custmize_model.md - label: Custom model + items: + - file: vision/ai.md + label: AI vision knowledge + - file: vision/classify.md + label: AI object classify + - file: vision/yolov5.md + label: YOLOv5 object detect + - file: vision/face_detection.md + label: Face detect and keypoints + - file: vision/face_recognition.md + label: Face recognition + - file: vision/body_key_points.md + label: Human critical point detection + - file: vision/self_learn_classifier.md + label: Self-learning classifier + - file: vision/self_learn_detector.md + label: Self-learning detector + - file: vision/object_track.md + label: Object tracking and counting + - file: vision/ocr.md + label: OCR + - file: vision/maixhub_train.md + label: MaixHub online AI training + - file: vision/custmize_model.md + label: Custom model - label: AI audio -- file: audio/record.md - label: Audio record -- file: audio/play.md - label: Play audio -- file: audio/classifier.md - label: AI voice classifier -- file: audio/keyword.md - label: Keyword recognize -- file: audio/recognize.md - label: Real-time voice recognize -- file: audio/synthesis.md - label: Speech synthesis + items: + - file: audio/record.md + label: Audio record + - file: audio/play.md + label: Play audio + - file: audio/classifier.md + label: AI voice classifier + - file: audio/keyword.md + label: Keyword recognize + - file: audio/recognize.md + label: Real-time voice recognize + - file: audio/synthesis.md + label: Speech synthesis - label: Video -- file: video/record.md - label: Video record -- file: video/play.md - label: Play video -- file: video/jpeg_streaming.md - label: JPEG stream -- file: video/rtsp.md - label: RTSP stream + items: + - file: video/record.md + label: Video record + - file: video/play.md + label: Play video + - file: video/jpeg_streaming.md + label: JPEG stream + - file: video/rtsp.md + label: RTSP stream - label: On-chip peripherals -- file: peripheral/gpio.md - label: GPIO -- file: peripheral/uart.md - label: UART -- file: peripheral/i2c.md - label: I2C -- file: peripheral/pwm.md - label: PWM -- file: peripheral/spi.md - label: SPI -- file: peripheral/wdt.md - label: WDT watchdog + items: + - file: peripheral/gpio.md + label: GPIO + - file: peripheral/uart.md + label: UART + - file: peripheral/i2c.md + label: I2C + - file: peripheral/pwm.md + label: PWM + - file: peripheral/spi.md + label: SPI + - file: peripheral/wdt.md + label: WDT watchdog - label: Off-chip modules -- file: modules/acc.md - label: Accelerometer -- file: modules/temp_hum.md - label: Temperature and humidity -- file: modules/tof.md - label: TOF -- file: modules/thermal_cam.md - label: Thermal imaging + items: + - file: modules/acc.md + label: Accelerometer + - file: modules/temp_hum.md + label: Temperature and humidity + - file: modules/tof.md + label: TOF + - file: modules/thermal_cam.md + label: Thermal imaging + +- label: Porjects + items: + - file: projects/README.md + label: Intro & Collection + - file: projects/line_tracking_robot.md + label: Line tracking robot - label: Advanced -- file: source_code/contribute.md - label: Contribute -- file: source_code/build.md - label: Build source code -- file: source_code/faq.md - label: MaixPy Source FAQ -- file: source_code/add_c_module.md - label: Write in C/C++ -- file: source_code/maixcdk.md - label: MaixCDK develop -- file: pro/compile_os.md - label: Build firmware + items: + - file: source_code/contribute.md + label: Contribute + - file: source_code/build.md + label: Build source code + - file: source_code/faq.md + label: MaixPy Source FAQ + - file: source_code/add_c_module.md + label: Write in C/C++ + - file: source_code/maixcdk.md + label: MaixCDK develop + - file: pro/compile_os.md + label: Build firmware diff --git a/maixpy/doc/en/source_code/add_c_module.html b/maixpy/doc/en/source_code/add_c_module.html index bb2411df..ede25ae9 100644 --- a/maixpy/doc/en/source_code/add_c_module.html +++ b/maixpy/doc/en/source_code/add_c_module.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/source_code/build.html b/maixpy/doc/en/source_code/build.html index 93290e3e..0e5858cf 100644 --- a/maixpy/doc/en/source_code/build.html +++ b/maixpy/doc/en/source_code/build.html @@ -102,7 +102,7 @@

MaixPy

@@ -212,18 +235,34 @@

MaixPy develop source code guide

Get source code

-
git clone https://github.com/sipeed/MaixPy
-cd MaixPy
+
mkdir -p ~/maix
+cd ~/maix
+git clone https://github.com/sipeed/MaixPy
 
+

Getting MaixCDK Source Code

+

The MaixPy project depends on MaixCDK. You need to clone it first and place it in a directory on your computer (do not place it under the MaixPy directory).

+ +
cd ~/maix
+git clone https://github.com/sipeed/MaixCDK
+
+

Then, you need to set the environment variable MAIXCAK_PATH to specify the path to MaixCDK, which can be added in ~/.bashrc or ~/.zshrc (depending on your shell):

+ +
export MAIXCAK_PATH=~/maix/MaixCDK
+
+

Only after successfully setting the environment variable can MaixPy locate the MaixCDK source code.

Build and pack to wheel

-
python setup.py bdist_wheel maixcam
+
cd ~/maix/MaixPy
+python setup.py bdist_wheel maixcam
 

maixcam Can be replaced with other board config, see setup.py 's platform_names variable.

After build success, you will find wheel file in dist directory, use pip install -U MaixPy****.wheel on your device to install or upgrade.

python setup.py bdist_wheel maixcam --skip-build will not execute build command and only pack wheel, so you can use maixcdk menuconfig and maixcdk build first to customize building.

+
+

Additionally, if you are debugging APIs and need to install frequently, using pip can be slow. You can compile and then copy the maix directory directly to the /usr/lib/python3.11/site-packages directory on your device to overwrite the old files.

+

Build manually

maixcdk build
diff --git a/maixpy/doc/en/source_code/contribute.html b/maixpy/doc/en/source_code/contribute.html
index 545110f2..e4e3741c 100644
--- a/maixpy/doc/en/source_code/contribute.html
+++ b/maixpy/doc/en/source_code/contribute.html
@@ -102,7 +102,7 @@ 

MaixPy

@@ -252,9 +275,9 @@

Contributing to MaixPy Code Co @@ -189,8 +212,8 @@

MaixPy Source Code FAQ

-
+

/usr/bin/ld: /lib/libgdal.so.30: undefined reference to `std::condition_variable::wait(std::unique_lockstd::mutex&)@GLIBCXX_3.4.30' collect2: error: ld returned 1 exit status

+

This issue commonly arises when building for Linux and using a conda environment, due to some libraries in the conda environment having compilation parameter problems. The solution is to not use conda, or to individually locate the problematic library within conda and replace it with the system's version or simply delete it (the system will then locate the necessary library).

diff --git a/maixpy/doc/en/source_code/maixcdk.html b/maixpy/doc/en/source_code/maixcdk.html index 1c944884..0f35a5e6 100644 --- a/maixpy/doc/en/source_code/maixcdk.html +++ b/maixpy/doc/en/source_code/maixcdk.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/video/jpeg_streaming.html b/maixpy/doc/en/video/jpeg_streaming.html index 0424d3b8..a9ea7b09 100644 --- a/maixpy/doc/en/video/jpeg_streaming.html +++ b/maixpy/doc/en/video/jpeg_streaming.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/vision/ai.html b/maixpy/doc/en/vision/ai.html index 89916de7..e1e8b8e5 100644 --- a/maixpy/doc/en/vision/ai.html +++ b/maixpy/doc/en/vision/ai.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/vision/apriltag.html b/maixpy/doc/en/vision/apriltag.html index 152dc611..d80277fd 100644 --- a/maixpy/doc/en/vision/apriltag.html +++ b/maixpy/doc/en/vision/apriltag.html @@ -102,7 +102,7 @@

MaixPy

@@ -246,7 +269,7 @@

MaixPy Apriltag Recognition

-

Before reading this article, make sure you are familiar with how to develop with MaixPy. For more details, please read MaixVision -- MaixPy Programming + Graphical Block Programming.

+

Before reading this article, make sure you are familiar with how to develop with MaixCAM. For more details, please read Quick Start.

Introduction

This article introduces how to use MaixPy to recognize Apriltag labels.

Using MaixPy to Recognize Apriltag Labels

diff --git a/maixpy/doc/en/vision/body_key_points.html b/maixpy/doc/en/vision/body_key_points.html index 83b7742f..be04477e 100644 --- a/maixpy/doc/en/vision/body_key_points.html +++ b/maixpy/doc/en/vision/body_key_points.html @@ -102,7 +102,7 @@

MaixPy

@@ -237,7 +260,7 @@

Usage

- Face detect + Face recognition diff --git a/maixpy/doc/en/vision/camera.html b/maixpy/doc/en/vision/camera.html index 400d1505..1cdc8373 100644 --- a/maixpy/doc/en/vision/camera.html +++ b/maixpy/doc/en/vision/camera.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/vision/classify.html b/maixpy/doc/en/vision/classify.html index 2daed247..63843dd3 100644 --- a/maixpy/doc/en/vision/classify.html +++ b/maixpy/doc/en/vision/classify.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/vision/custmize_model.html b/maixpy/doc/en/vision/custmize_model.html index 8a93376b..92b116ae 100644 --- a/maixpy/doc/en/vision/custmize_model.html +++ b/maixpy/doc/en/vision/custmize_model.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/vision/display.html b/maixpy/doc/en/vision/display.html index 44015e52..a0cc80ce 100644 --- a/maixpy/doc/en/vision/display.html +++ b/maixpy/doc/en/vision/display.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/vision/face_detection.html b/maixpy/doc/en/vision/face_detection.html new file mode 100644 index 00000000..d8a946c5 --- /dev/null +++ b/maixpy/doc/en/vision/face_detection.html @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MaixPy Face Detection and Key Points Detection - MaixPy + + + + + + + + + + +
+ +
+ +
+
+
+
+ +

MaixPy Face Detection and Key Points Detection

+ +
+
+
    + +
+
+
+
+ + +
+
+ + + +
+
+
+
+ + +
+
+ +
+
+ +

Introduction

+

Face detection can be used in many places, such as providing the step of face detection for face recognition, or applications related to face tracking, and more.

+

The face detection provided here can not only detect faces but also detect 5 key points, including two eyes, one nose, and the two corners of a mouth.

+

face detection

+

Using Face Detection in MaixPy

+

MaixPy officially provides two face detection models, sourced from the open projects face detector 1MB with landmark and Retinaface.

+

To use them, first download a model, either one as there's not much difference between them:

+ +

Then copy the model file to your device, see Using MaixVision for how to copy.

+
+

The default image contains a file that can be used directly; if not available, you must download it yourself. The downloaded zip package contains multiple resolutions to choose from; the higher the resolution, the more precise but also more time-consuming.

+
+

Next, run the code. The following line of commented code is for loading the Retinaface model, choose which line of code to use based on the model you downloaded.

+
+

To use this function, MaixPy must >= 4.1.4.

+
+ +
from maix import camera, display, image, nn, app
+import math
+
+detector = nn.FaceDetector(model="/root/models/face_detector.mud")
+# detector = nn.Retinaface(model="/root/models/retinaface.mud")
+
+cam = camera.Camera(detector.input_width(), detector.input_height(), detector.input_format())
+dis = display.Display()
+
+while not app.need_exit():
+    img = cam.read()
+    objs = detector.detect(img, conf_th = 0.4, iou_th = 0.45)
+    for obj in objs:
+        img.draw_rect(obj.x, obj.y, obj.w, obj.h, color = image.COLOR_RED)
+        radius = math.ceil(obj.w / 10)
+        img.draw_keypoints(obj.points, image.COLOR_RED, size = radius if radius < 5 else 4)
+    dis.show(img)
+
+
+ + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maixpy/doc/en/vision/face_recognition.html b/maixpy/doc/en/vision/face_recognition.html index 943253ff..d1d238ec 100644 --- a/maixpy/doc/en/vision/face_recognition.html +++ b/maixpy/doc/en/vision/face_recognition.html @@ -102,7 +102,7 @@

MaixPy

@@ -259,9 +282,9 @@

Using MaixPy

@@ -257,7 +280,7 @@

MaixPy Find Blobs

-

Before reading this article, make sure you know how to develop with MaixPy. For details, please read MaixVision -- MaixPy Programming + Graphical Block Programming.

+

Before reading this article, make sure you know how to develop with MaixCAM. For details, please read Quick Start.

Introduction

This article will introduce how to use MaixPy to find color blobs and how to use the default application of MaixCam to find color blobs.

In vision applications, finding color blobs is a very common requirement, such as robots finding color blobs, automated production lines finding color blobs, etc., which requires identifying specific color areas in the image and obtaining information such as the position and size of these areas.

@@ -423,8 +446,8 @@

About the LAB Color Space

diff --git a/maixpy/doc/en/vision/line_tracking.html b/maixpy/doc/en/vision/line_tracking.html new file mode 100644 index 00000000..bbe8c5be --- /dev/null +++ b/maixpy/doc/en/vision/line_tracking.html @@ -0,0 +1,536 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MaixPy Line Tracking - MaixPy + + + + + + + + + + +
+ +
+ +
+
+
+
+ +

MaixPy Line Tracking

+ +
+
+
    + +
+
+
+
+ + + + +
+
+ + + +
+
+
+
+ + +
+
+ + +
+ + Update history +
+ + + + + + + + + + + + + + + + + + + +
DateVersionAuthorUpdate content
2024-05-091.0.0lxowalle + + Initial document + +
+
+
+ +
+
+ +

Before reading this article, make sure you already know how to develop MaixCAM. For details, please read Quick Start.

+

Introduction

+

In vision applications, the function of tracking line is often required in applications such as line-following robot. In this article, we will describe:

+
    +
  • How to use MaixPy to tracking line.

    +
  • +
  • How to tracking line using MaixCam's default application

    +
  • +
+

How to use MaixPy to tracking line

+

The maix.image.Image module in MaixPy provides the get_regression method, which can conveniently tracking line.

+

Code example

+

A simple example of finding and drawing a line.

+ +
from maix import camera, display, image
+
+cam = camera.Camera(320, 240)
+disp = display.Display()
+
+# thresholds = [[0, 80, 40, 80, 10, 80]] # red
+thresholds = [[0, 80, -120, -10, 0, 30]] # green
+# thresholds = [[0, 80, 30, 100, -120, -60]] # blue
+
+while 1:
+    img = cam.read()
+
+    lines = img.get_regression(thresholds, area_threshold = 100)
+    for a in lines:
+        img.draw_line(a.x1(), a.y1(), a.x2(), a.y2(), image.COLOR_GREEN, 2)
+        theta = a.theta()
+        rho = a.rho()
+        if theta > 90:
+            theta = 270 - theta
+        else:
+            theta = 90 - theta
+        img.draw_string(0, 0, "theta: " + str(theta) + ", rho: " + str(rho), image.COLOR_BLUE)
+
+    disp.show(img)
+
+

Steps:

+
    +
  1. import image, camera, display modules

    + +
    from maix import image, camera, display
    +
    +
  2. +
  3. Initialize camera and display

    + +
    cam = camera.Camera(320, 240) # Initialise camera, output resolution 320x240 in RGB format.
    +disp = display.Display()
    +
    +
  4. +
  5. Get the image from the camera and display it

    + +
    while 1:
    +    img = cam.read()
    +    disp.show(img)
    +
    +
  6. +
  7. Call the get_regression method to find the straight line in the camera image and draw it to the screen

    + +
    lines = img.get_regression(thresholds, area_threshold = 100)
    +for a in lines:
    +   img.draw_line(a.x1(), a.y1(), a.x2(), a.y2(), image.COLOR_GREEN, 2)
    +   theta = a.theta()
    +   rho = a.rho()
    +   if theta > 90:
    +      theta = 270 - theta
    +   else:
    +      theta = 90 - theta
    +   img.draw_string(0, 0, "theta: " + str(theta) + ", rho: " + str(rho), image.COLOR_BLUE)
    +
    +
      +
    • img is the camera image read via cam.read(), when initialised as cam = camera.Camera(320, 240), the img object is an RGB image with a resolution of 320x240.
    • +
    • img.get_regression is used to find straight lines, thresholds is a list of colour thresholds, each element is a colour threshold, multiple thresholds are passed in if multiple thresholds are found at the same time, and each colour threshold has the format [L_MIN, L_MAX, A_MIN, A_MAX, B_MIN, B_MAX], where L, A, B are the three channels of LAB colour space, L channel is the luminance, A channel is the red-green channel, B channel is the blue-yellow channel. pixels_threshold is a pixel area threshold used to filter some unwanted straight lines.
    • +
    • for a in lines is used to iterate through the returned Line objects, where a is the current Line object. Normally the get_regression function will only return one Line object, but if you need to find more than one line, try the find_line method.
    • +
    • Use img.draw_line to draw the found line, a.x1(), a.y1(), a.x2(), a.y2() represent the coordinates of the ends of the line.
    • +
    • Use img.draw_string to show the angle between the line and the x-axis in the upper left corner, and a.theta() is the angle between the line and the y-axis, which is converted to theta for easier understanding, a.rho() is the length of the vertical line from the origin to the line.
    • +
    +
  8. +
  9. Run the code through the maixvision, you can find the line, look at the effect!

    +

    image-20240509110204007

    +
  10. +
+

Common Parameter Explanations

+

Here are explanations of commonly used parameters. If you cannot find parameters that can implement your application, you may need to consider using other algorithms or extending the required functionality based on the current algorithm's results.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescriptionExample
thresholdsThresholds based on the LAB color space, thresholds=[[l_min, l_max, a_min, a_max, b_min, b_max]], representing:
Brightness range [l_min, l_max]
Green to red component range [a_min, a_max]
Blue to yellow component range [b_min, b_max]
Multiple thresholds can be set simultaneously
Set two thresholds to detect red and green
img.find_blobs(thresholds=[[0, 80, 40, 80, 10, 80], [0, 80, -120, -10, 0, 30]])
Red threshold is [0, 80, 40, 80, 10, 80]
Green threshold is [0, 80, -120, -10, 0, 30]
invertEnable threshold inversion, when enabled, the passed thresholds are inverted. Default is False.Enable threshold inversion
img.find_blobs(invert=True)
roiSet the rectangular region for the algorithm to compute, roi=[x, y, w, h], where x and y represent the coordinates of the top-left corner of the rectangle, and w and h represent the width and height of the rectangle, respectively. The default is the entire image.Compute the region at (50, 50) with a width and height of 100
img.find_blobs(roi=[50, 50, 100, 100])
area_thresholdFilter out blobs with a pixel area smaller than area_threshold, in units of pixels. The default is 10. This parameter can be used to filter out some useless small blobs.Filter out blobs with an area smaller than 1000
img.find_blobs(area_threshold=1000)
pixels_thresholdFilter out blobs with fewer valid pixels than pixels_threshold. The default is 10. This parameter can be used to filter out some useless small blobs.Filter out blobs with fewer than 1000 valid pixels
img.find_blobs(pixels_threshold=1000)
+

This article introduces commonly used methods. For more APIs, please see the image section of the API documentation.

+

How to tracking line using MaixCam's default application

+

To quickly verify the line tracking functionality, you can use the line_tracking application provided by MaixCam to experience the line finding effect.

+

How to use it

+
    +
  1. Select and open the Line tracking application.
  2. +
  3. Click on the line in the screen that needs to be identified and the colour of the line will be displayed on the left hand side
  4. +
  5. Click on the colour to be detected on the left (the colour below L A B in the screen)
  6. +
  7. The line will be identified and the coordinates and angle of the line will be output from the serial port.
  8. +
+

Demo

+

+

Advanced operations

+

Manual adjustment of LAB threshold to tracking line

+

The application provides manual setting of LAB threshold to tracking line accurately.

+

Steps:

+
    +
  1. Click the options icon in the bottom-left corner to enter configuration mode.
  2. +
  3. Point the camera at the object you need to find, click on the target object on the screen, and the left side will display a rectangular frame of the object's color and show the LAB values of that color.
  4. +
  5. Click on the bottom options L Min, L Max, A Min, A Max, B Min, B Max. After clicking, a slider will appear on the right side to set the value for that option. These values correspond to the minimum and maximum values of the L, A, and B channels in the LAB color format, respectively.
  6. +
  7. Referring to the LAB values of the object color calculated in step 2, adjust L Min, L Max, A Min, A Max, B Min, B Max to appropriate values to identify the corresponding color blobs. For example, if LAB = (20, 50, 80), since L=20, to accommodate a certain range, set L Min=10 and L Max=30. Similarly, since A=50, set A Min=40 and A Max=60. Since B=80, set B Min=70 and B Max=90.
  8. +
+

Getting Detection Data via Serial Protocol

+

The line tracking application supports reporting detected straight line information via the serial port (default baud rate is 115200).

+

Since only one report message is sent, we can illustrate the content of the report message with an example.

+

For instance, if the report message is:

+ +
AA CA AC BB 0E 00 00 00 00 E1 09 FC 01 01 00 E9 01 6F 01 57 00 C1 C6
+
+
    +
  • AA CA AC BB: Protocol header, fixed content

    +
  • +
  • 0E 00 00 00: Data length, the total length excluding the protocol header and data length, here means the length is 14.

    +
  • +
  • E1: Flag bit, used to identify the serial message flag

    +
  • +
  • 09: Command type, for the line tracking application, this value is fixed at 0x09.

    +
  • +
  • FC 01 01 00 E9 01 6F 01 57 00: The coordinates and angle information for both ends of line, with each value represented as a 2-byte value in little-end format. FC 01 and 01 00 indicate that the coordinates of the first endpoint are (508, 1), E9 01 and 6F 01 indicate that the coordinates of the second endpoint are (489, 367), and 57 00 indicates that the angle of the line to the x-axis is 87 degrees

    +
  • +
  • C1 C6: CRC checksum value, used to verify if the frame data has errors during transmission.

    +
  • +
+ + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maixpy/doc/en/vision/maixhub_train.html b/maixpy/doc/en/vision/maixhub_train.html index 0334a01f..5233dea3 100644 --- a/maixpy/doc/en/vision/maixhub_train.html +++ b/maixpy/doc/en/vision/maixhub_train.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/vision/object_track.html b/maixpy/doc/en/vision/object_track.html index feafd5a2..8eedf2cb 100644 --- a/maixpy/doc/en/vision/object_track.html +++ b/maixpy/doc/en/vision/object_track.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/vision/qrcode.html b/maixpy/doc/en/vision/qrcode.html index f773fdbc..282678e5 100644 --- a/maixpy/doc/en/vision/qrcode.html +++ b/maixpy/doc/en/vision/qrcode.html @@ -102,7 +102,7 @@

MaixPy

@@ -246,7 +269,7 @@

MaixPy QR Code Recognition

-

Before reading this article, make sure you are familiar with how to develop with MaixPy. For details, please read MaixVision -- MaixPy Programming + Graphical Block Programming

+

Before reading this article, make sure you are familiar with how to develop with MaixCAM. For details, please read Quick Start.

Introduction

This article explains how to use MaixPy for QR code recognition.

Using MaixPy to Recognize QR Codes

@@ -339,9 +362,9 @@

Common Parameter Explanation

diff --git a/maixpy/doc/en/vision/self_learn_detector.html b/maixpy/doc/en/vision/self_learn_detector.html index dda43445..6cb1a257 100644 --- a/maixpy/doc/en/vision/self_learn_detector.html +++ b/maixpy/doc/en/vision/self_learn_detector.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/en/vision/yolov5.html b/maixpy/doc/en/vision/yolov5.html index 24181af3..88c5d44a 100644 --- a/maixpy/doc/en/vision/yolov5.html +++ b/maixpy/doc/en/vision/yolov5.html @@ -102,7 +102,7 @@

MaixPy

@@ -253,8 +276,8 @@

Training Your Own Object Detec diff --git a/maixpy/doc/zh/basic/app.html b/maixpy/doc/zh/basic/app.html index 5b440849..85f503a0 100644 --- a/maixpy/doc/zh/basic/app.html +++ b/maixpy/doc/zh/basic/app.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/zh/basic/app_usage.html b/maixpy/doc/zh/basic/app_usage.html index 446e1cfd..5d7b2a83 100644 --- a/maixpy/doc/zh/basic/app_usage.html +++ b/maixpy/doc/zh/basic/app_usage.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/zh/basic/linux_basic.html b/maixpy/doc/zh/basic/linux_basic.html index 7dba26f9..c49c03e6 100644 --- a/maixpy/doc/zh/basic/linux_basic.html +++ b/maixpy/doc/zh/basic/linux_basic.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/zh/basic/maixpy_upgrade.html b/maixpy/doc/zh/basic/maixpy_upgrade.html index 87a1773f..78871064 100644 --- a/maixpy/doc/zh/basic/maixpy_upgrade.html +++ b/maixpy/doc/zh/basic/maixpy_upgrade.html @@ -102,7 +102,7 @@

MaixPy

diff --git a/maixpy/doc/zh/basic/maixvision.html b/maixpy/doc/zh/basic/maixvision.html index 8eb77a7e..3a8402e9 100644 --- a/maixpy/doc/zh/basic/maixvision.html +++ b/maixpy/doc/zh/basic/maixvision.html @@ -44,7 +44,7 @@ - MaixVision -- MaixPy 编程 + 图形化积木编程 - MaixPy + MaixVision -- MaixPy 编程 IDE + 图形化积木编程 - MaixPy @@ -102,7 +102,7 @@

MaixPy

@@ -175,7 +198,7 @@

MaixPy

-

MaixVision -- MaixPy 编程 + 图形化积木编程

+

MaixVision -- MaixPy 编程 IDE + 图形化积木编程

@@ -211,9 +234,11 @@

MaixVision -- MaixPy 编程 + 图形化积木编程

简介

-

MaixVision 是专为 Maix 生态打造的一款开发者编程工具,支持 MaixPy 编程和图形化积木编程,同时支持在线运行和调试,以及实时预览图像,可以同步设备显示屏的图像,方便调试和开发。

+

MaixVision 是专为 Maix 生态打造的一款开发者编程工具,支持 MaixPy 编程和图形化积木编程,同时支持在线运行和调试,以及实时预览图像,可以同步设备显示屏的图像,方便调试和开发。

以及支持打包应用和安装应用到设备,方便用户一键生成、安装应用。

同时还集成一些方便开发的小工具,比如文件管理,阈值编辑器,二维码生成等等。

+

下载

+

访问 MaixVision 主页 下载。

使用 MaixPy 编程和在线运行

按照快速开始的步骤连接设备,我们可以很方便地使用 MaixPy 编程和在线运行。

实时预览图像

@@ -228,11 +253,30 @@

实时预览图

这里我们用摄像头读取了图像,然后通过disp.show()方法将图像显示到屏幕上,同时也会发送到 MaixVision 显示。

当我们点击了右上角的暂停按钮,就会停止发送图像到 MaixVision 显示。

+

代码自动补全

+

代码提示依赖电脑本地的 Python 包,为了实现代码提示,我们需要在电脑中安装 Python,并且安装需要提示的 Python 包。

+
    +
  • 安装 Python 请访问 Python 官网安装。
  • +
  • 安装需要提示的包,比如对于 MaixPy, 你需要在电脑也安装一份 MaixPy 包,在电脑使用pip install MaixPy即可安装好,如果MaixPy更新了,你也需要在电脑和设备更新到MaixPy,电脑手动在终端执行pip install MaixPy -U即可,设备更新直接在设置应用中更新即可。
  • +
+
+

中国国内用户可以使用国内镜像pip install -i https://pypi.tuna.tsinghua.edu.cn/simple MaixPy

+
+
    +
  • 重启 MaixVision 就能够看到代码提示了。
  • +
+
+

如果仍然不能提示,可以手动在设置中设置 python 可执行文件的路径后重启。

+
+
+

注意在电脑安装 Python 包这里只是为了用作代码提示,实际代码运行还是在设备(开发板)上,设备上也要有对应的包才能正常运行。

+
+
+

另外,虽然你在电脑上安装了 MaixPy 包,但是由于我们精力有限,我们不确保你能直接在电脑的 Python 导入 maix 包进行使用,请在支持的设备上运行。

+

计算图像的直方图

在上一步中我们可以在 MaixVision 中实时看到图像,我们用鼠标框选一个区域,图像下方就能看到这个区域的直方图了,选择不同的颜色表示方法,可以看到不同的颜色通道的直方图。

这个功能方便我们在做某些图像处理算法时找到一些合适的参数。

-

使用图形化积木编程

-

开发中,敬请期待。

区分设备文件系统电脑文件系统

这里我们有一个比较重要的概念需要掌握:分清楚设备文件系统电脑文件系统