Skip to content

Conversation

inspireMeNow
Copy link
Contributor

@inspireMeNow inspireMeNow commented Aug 11, 2025

This pull request adds MicroPython bindings for the NCNN C API, enabling developers to run NCNN neural network inference directly within MicroPython environments.

Changes:

  • Introduced a new micropython/c_api directory containing the binding source files.

  • Wrapped core NCNN functionalities (e.g., model loading, extractor creation) with MicroPython C extension functions.

  • Defined MicroPython objects and their methods to make the NCNN API easy to use like regular Python code.

  • Added instructions for compiling the bindings on supported platforms.

  • Added test example for NCNN API

@tencent-adm
Copy link
Member

tencent-adm commented Aug 11, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Aug 11, 2025

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15124728 15124728 0 😘
armhf 6155744 6155744 0 😘
aarch64 9453192 9453192 0 😘

- Add test suite with broad coverage of API functions
- Fix memory management and parameter handling issues
- Improve error and buffer handling
- Enable NCNN_PIXEL_DRAWING feature by default
@inspireMeNow inspireMeNow changed the title [WIP] Add NCNN MicroPython C API Bindings Add NCNN MicroPython C API Bindings Aug 18, 2025
@nihui
Copy link
Member

nihui commented Aug 21, 2025

感谢你的工作,请将你在实现中的笔记和心得,遇到的困难和解决方法等,记录成文章,发表在discussion分区,这将作为知识总结 https://github.com/Tencent/ncnn/discussions

Thank you for your work. Please record your notes and experience in the implementation, difficulties encountered and solutions, etc. into an article and publish it in the discussion section. This will serve as a knowledge summary. https://github.com/Tencent/ncnn/discussions

- Reorganize source files into src/ and include/ directories
- Update build configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants