{"id":1448,"date":"2026-06-28T16:10:12","date_gmt":"2026-06-28T08:10:12","guid":{"rendered":"https:\/\/imuslab.com\/wordpress\/?p=1448"},"modified":"2026-06-28T16:10:40","modified_gmt":"2026-06-28T08:10:40","slug":"cnnaio_pure-golang-cnn-inference-server","status":"publish","type":"post","link":"https:\/\/imuslab.com\/wordpress\/2026\/06\/28\/cnnaio_pure-golang-cnn-inference-server\/","title":{"rendered":"cnnaio\uff1a\u7528 pure Go \u5728 homelab \u4e0a\u57f7\u884c CNN Inference\uff0c\u4e0d\u7528 Python\u3001\u4e0d\u7528 cgo"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u524d\u8a00<\/h2>\n\n\n\n<p>\u8a71\u8aaa\u6211\u7684 homelab \u88e1\u4e00\u76f4\u6709\u500b\u5f88\u9ebb\u7169\u7684\u9700\u6c42\uff1a\u60f3\u5e6b ArozOS \u52a0\u5165\u76f8\u7247\u81ea\u52d5\u5206\u985e\uff0c\u9019\u5176\u5be6\u662f\u5c6c\u65bc\u5f88\u57fa\u672c\u7684 CNN Inference \u529f\u80fd\u3002\u4e4b\u524d ArozOS v2 \u7684\u521d\u671f\u78ba\u5be6\u662f\u6709\u5617\u8a66\u52a0\u5165 darknet + yolo5 \u652f\u63f4\uff0c\u4f46\u662f\u554f\u984c\u662f\u6574\u5305\u6771\u897f\u52a0\u8d77\u4f86\u5feb 250+MB \u4e0d\u6b62\uff0c\u9084\u8981\u6bcf\u6b21\u904b\u4f5c\u90fd\u6703\u628a\u6574\u53f0\u4f3a\u670d\u5668\u7684\u8cc7\u6e90\u5361\u6b7b\uff0c\u8d85\u7d1a\u7121\u6575\u7684\u4e0d\u597d\u7528\uff0c\u6240\u4ee5\u5728\u5f8c\u671f\u7248\u672c\u7684 ArozOS v2 \u5c31\u628a\u9019\u90e8\u5206\u780d\u6389\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"608\" src=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/\u5716\u7247-3-1024x608.png\" alt=\"\" class=\"wp-image-1457\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/\u5716\u7247-3-1024x608.png 1024w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/\u5716\u7247-3-300x178.png 300w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/\u5716\u7247-3-768x456.png 768w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/\u5716\u7247-3-1200x712.png 1200w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/\u5716\u7247-3.png 1235w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">ArozOS v3 \u7684 Photo App\uff0c\u76ee\u524d\u53ea\u80fd\u900f\u904e EXIF data \u4f5c\u5206\u985e\u8207 search<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u5176\u4ed6 Deployment \u65b9\u6848\uff1f<\/h3>\n\n\n\n<p>\u78ba\u5be6\u5982\u679c\u662f\u4e0d\u9700\u8981 portable \u7684\u8a71\uff0c\u78ba\u5be6\u6709\u66f4\u5e38\u898b\u7684\u505a\u6cd5\uff0c\u4f8b\u5982<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u628a\u6574\u5957 Tensorflow \u88dd\u4e0b\u4f86\uff1a\u5148\u88dd\u4e00\u6574\u5957 Python\uff0c\u7136\u5f8c pip install \u4e00\u5806\u6771\u897f\uff0cPyTorch \u6216 onnxruntime \u96a8\u4fbf\u5c31\u5e7e\u767e MB\uff08\u73fe\u5728\u786c\u789f\u597d\u8cb4\u5594<\/li>\n\n\n\n<li>\u4f7f\u7528 CGO \u900f\u904e C ecosystem \u7684 linker \u628a go code \u63a5\u4e0a OpenCV\uff0c\u7136\u5f8c\u5728 cross compile \u7684\u6642\u5019\u88ab\u4e00\u5806 native library \u641e\u5230\u61f7\u7591\u4eba\u751f\u3002\u5728\u4e00\u53f0\u4f4e\u529f\u8017\u7684\u4f3a\u670d\u5668\u4e0a\uff08\u4f8b\u5982 Raspberry Pi \u6216\u662f NUC \u4e4b\u985e\u7684\uff09\uff0c\u9019\u7a2e\u505a\u6cd5\u5be6\u5728\u662f\u6bba\u96de\u7528\u725b\u5200\uff0c\u800c\u4e14\u6bcf\u6b21\u63db\u6a5f\u90fd\u8981\u91cd\u65b0\u88dd\u4e00\u6b21\u74b0\u5883\uff0c\u7136\u5f8c\u53c8\u5404\u7a2e\u7248\u672c\u4e0d\u76f8\u5bb9\uff08<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u53d7\u4e0d\u4e86\u6240\u4ee5\u4f86\u81ea\u5e79\u4e00\u5957<\/h2>\n\n\n\n<p>\u6240\u4ee5\u6211\u5c31\u5beb\u4e86\u9019\u500b cnnaio (CNN &#8211; All in one) \u7cfb\u7d71<\/p>\n\n\n\n<p>\u4e00\u53e5\u8a71\u7e3d\u7d50\uff0c\u5b83\u662f\u4e00\u500b\u5168\u90e8\u7528 pure Go \u5beb\u6210\u3001\u96f6\u5916\u90e8\u4f9d\u8cf4\u3001\u55ae\u4e00\u57f7\u884c\u6a94\u7684 CNN Inference RESTFUL API server\u3002\u6c92\u6709 Python\u3001\u6c92\u6709 cgo\u3001\u6c92\u6709 CUDA\u3001\u6c92\u6709\u4efb\u4f55\u7cfb\u7d71 library\uff0c\u9023 model \u6a94\u6848\u90fd\u4e0d\u7528\u53e6\u5916\u5e36\u3002\u4e1f\u5230 Raspberry Pi \u6216\u8005\u4e00\u53f0\u9000\u5f79\u7684 NUC \u4e0a\uff0c\u4f60\u5c31\u6709\u4e00\u500b\u81ea\u5df1\u7684 vision API \u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u90a3\u5b83\u5230\u5e95\u662f\u600e\u9ebc\u505a\u5230\u300c\u7d14 Go \u53c8\u80fd\u8dd1 ncnn\u300d\u7684\uff1f<\/h3>\n\n\n\n<p>\u6838\u5fc3\u5176\u5be6\u662f ncnn \uff0c\u5c31\u662f nihui \uff08\u4f86\u81ea\u4e0a\u6d77\u7684\u6280\u8853<s>\u5973\u88dd<\/s>\u5927\u4f6c\uff09\u5c08\u9580\u70ba\u624b\u6a5f\u8ddf Edge CPU \u800c\u958b\u767c\u7684 CNN runtime framework\uff0c\u6548\u80fd\u5f88\u597d\u3001\u5f88\u8f15\u91cf\u3002\u4f46 ncnn \u662f C++ \u5beb\u7684\uff0c\u6b63\u5e38\u60c5\u6cc1\u4e0b\u4f60\u8981\u561b cgo \u7d81\u5b83\uff0c\u8981\u561b\u5c31\u5f97 cross compile\uff0c\u5728 go build \u7684\u6642\u5019\u9084\u662f\u6703\u6709 build time dependencies \u7684\u554f\u984c\u3002<\/p>\n\n\n\n<p>\u7136\u5f8c\u6211\u770b\u5230 ncnn Github page \u6709\u9019\u500b release\uff0c\u71c8\u6ce1\u5c31\u5f48\u51fa\u4f86\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"886\" height=\"335\" src=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/\u5716\u7247.png\" alt=\"\" class=\"wp-image-1449\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/\u5716\u7247.png 886w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/\u5716\u7247-300x113.png 300w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/\u5716\u7247-768x290.png 768w\" sizes=\"auto, (max-width: 886px) 100vw, 886px\" \/><\/figure>\n\n\n\n<p>\u90a3\u6211\u7528 WebAssembly \u8dd1\u4e0d\u5c31\u597d\u4e86\u55ce\uff1f\u65bc\u662f\u6211\u627e Claude \u5e6b\u6211\u628a ncnn\uff08\u518d\u52a0\u4e0a stb_image \u8ddf\u4e00\u500b\u6211\u5f9e\u7db2\u7d61\u4e0a copy &amp; modify &amp; paste \u7684 C driver\uff09\u6574\u500b\u7de8\u8b6f\u6210\u4e00\u500b WASI \u7684 WebAssembly \u6a21\u7d44\uff0c\u7136\u5f8c\u7528 wazero &#8211; \u4e00\u500b\u7d14 Go \u5beb\u7684 WASM runtime \u628a\u5b83\u5305\u8d77\u4f86\u8dd1\u3002<\/p>\n\n\n\n<p>\u9019\u6a23\u4e00\u4f86\uff0c\u6574\u500b\u67b6\u69cb\u5c31\u4e7e\u6de8\u4e86\u3002\u56e0\u70ba wazero \u81ea\u5df1\u6703 compile wasm\uff0c\u5b8c\u5168\u4e0d\u9700\u8981 cgo\uff0c\u6240\u4ee5 CGO_ENABLED=0 \u5c31\u80fd\u76f4\u63a5 cross compile \u5230 Windows \/ macOS \/ Linux \u7684 amd64 \u8ddf arm64\uff0c\u9023 toolchain \u90fd\u4e0d\u7528\u6bcf\u500b\u5e73\u53f0\u6e96\u5099\u4e00\u4efd\u3002\u66f4\u9177\u7684\u662f wasm \u672c\u9ad4\u8ddf\u6bcf\u4e00\u500b model \u7684 weight\uff0c\u5168\u90e8\u90fd\u7528 go:embed \u6253\u5305\u9032 binary \u88e1\u9762\uff0c\u6240\u4ee5\u6700\u5f8c\u5c31\u771f\u7684\u662f\u4e00\u500b\u81ea\u6211\u5305\u542b\u7684\u57f7\u884c\u6a94\uff0c\u4ec0\u9ebc\u90fd\u4e0d\u7528\u53e6\u5916\u5305\u88dd\uff0c\u5b8c\u6574\u7684\u5305\u5728\u9019\u5305 66MB \u7684 binary executable \u88e1\u9762\uff08<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6dfa\u8ac7\u67b6\u69cb<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"757\" src=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/arch-diagram-1024x757.png\" alt=\"\" class=\"wp-image-1450\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/arch-diagram-1024x757.png 1024w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/arch-diagram-300x222.png 300w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/arch-diagram-768x568.png 768w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/arch-diagram.png 1144w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u67b6\u69cb\u4e0a\u6709\u5e7e\u500b\u6211\u81ea\u5df1\u89ba\u5f97\u883b\u6709\u8da3\u7684\u5730\u65b9\u3002<\/p>\n\n\n\n<p><strong>\u7b2c\u4e00\u662f WASM \u5e36\u4f86\u7684 isolation<\/strong>\u3002\u6bcf\u4e00\u6b21 inference\uff0c\u5176\u5be6\u90fd\u662f\u5728\u4e00\u500b\u5168\u65b0\u7684\u3001\u7368\u7acb\u7684 module instance \u88e1\u9762\u8dd1\u7684\u3002model \u6a94\u6848\u662f READ ONLY mount \u5230 sandbox \u7684 \/models\uff0c\u8f38\u5165\u7684\u5716\u7247\u5247\u662f\u900f\u904e\u4e00\u500b in-memory \u7684\u6a94\u6848\u7cfb\u7d71 (memFS) mount \u5230 \/input\uff0c\u6240\u4ee5\u6574\u500b\u904e\u7a0b\u5b8c\u5168\u4e0d\u6703\u78b0\u5230 host \u7684\u786c\u789f\uff0c\u4e0d\u540c\u7684\u8acb\u6c42\u4e4b\u9593\u4e5f\u4e0d\u6703\u5171\u7528\u4efb\u4f55\u72c0\u614b\u3002\u4e00\u500b\u63a8\u7406\u5c31\u7b97\u70b8\u4e86\uff0c\u4e5f\u8dd1\u4e0d\u51fa\u90a3\u500b\u6c99\u76d2\u3002\u5c0d\u65bc\u4e00\u53f0\u8981 24\/7 \u904b\u4f5c\u7684 homelab server \u800c\u8a00\uff0c\u9019\u7a2e\u9694\u96e2\u6211\u9084\u89ba\u5f97\u6eff\u91cd\u8981\u7684\u3002\uff08\u7576\u7136\u5f88\u591a\u4eba\u61f6\u8d77\u4f86\u5c31\u76f4\u63a5 docker \u4f86\u505a\u9694\u96e2\uff0c\u984d\u3002\u3002\u3002\uff09<\/p>\n\n\n\n<p><strong>\u7b2c\u4e8c\u662f\u591a session \u7684 concurrency<\/strong>\u3002\u4e00\u500b ncnn session \u64c1\u6709 wazero runtime \u8ddf\u5df2\u7d93\u7de8\u8b6f\u597d\u7684 wasm\uff0c\u800c\u7de8\u8b6f\u9019\u4ef6\u4e8b\u5927\u6982\u8981\u82b1\u5e7e\u767e ms\uff0c\u6240\u4ee5\u4f60\u7d55\u5c0d\u4e0d\u6703\u60f3\u6bcf\u6b21\u8acb\u6c42\u90fd\u958b\u4e00\u500b\u2014\u2014\u800c\u662f\u5efa\u4e00\u500b\u4e4b\u5f8c\u91cd\u8907\u7528\u3002\u4f46\u540c\u4e00\u500b session \u662f sequential \u57f7\u884c\u7684\uff0c\u8981 support concurrent request handling \u600e\u9ebc\u8fa6\uff1f\u5f88\u7c21\u55ae\uff0c\u958b\u591a\u5e7e\u500b\u5c31\u597d\u3002\u4f3a\u670d\u5668\u9019\u908a\u5c31\u662f keep track \u4e00\u500b -j N \u5927\u5c0f\u7684 session pool\uff0cN \u500b\u7368\u7acb\u7684 runtime \u540c\u6642\u53ef\u4ee5\u670d\u52d9 N \u500b\u8acb\u6c42\u3002\u9019\u500b primitive \u6211\u4e5f\u76f4\u63a5\u958b\u653e\u7d66 library \u7684\u4f7f\u7528\u8005\uff0c\u4f60\u53ef\u4ee5\u81ea\u5df1\u6c7a\u5b9a\u8981\u958b\u5e7e\u500b WASM runtime instance\u3002<\/p>\n\n\n\n<p>\u529f\u80fd\u65b9\u9762\uff0c\u76ee\u524d\u4e00\u5171\u585e\u4e86 11 \u500b\u6a21\u578b\u3001\u6db5\u84cb 11 \u7a2e\u8996\u89ba\u4efb\u52d9\uff1a\u5f71\u50cf\u5206\u985e\uff08MobileNetV2\u3001YOLO11-cls\uff09\u3001\u7269\u4ef6\u5075\u6e2c\uff08YOLO11\u3001NanoDet-Plus\uff09\u3001\u5be6\u4f8b\u5206\u5272\u3001\u59ff\u614b\u4f30\u8a08\u3001\u65cb\u8f49\u6846\u5075\u6e2c\uff08OBB\uff09\u3001\u4eba\u81c9\u5075\u6e2c\uff08Ultra-Light\uff09\u300198 \u9ede\u4eba\u81c9\u7279\u5fb5\u9ede\uff08PFLD\uff09\u3001\u4eba\u81c9\u7279\u5fb5\u5411\u91cf\u8207\u6bd4\u5c0d\uff08MobileFaceNet\uff09\uff0c\u9084\u6709\u6027\u5225\u5206\u985e\u3002\u57fa\u672c\u4e0a homelab \u81ea\u52d5\u5316\u6703\u7528\u5230\u7684\u6771\u897f\u90fd\u6709\u4e86\u3002\u5c31\u662f age detection \u56e0\u70ba\u6c92\u6709\u627e\u5230\u597d\u7528\u7684\u6a21\u578b\u76ee\u524d\u9084\u751f\u4e0d\u51fa\u4f86\uff08\u770b\u770b\u4e4b\u5f8c\u6709\u6c92\u6709\u4eba\u6709\u8208\u8da3\u4f86 contribute\uff09<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">API \u8a2d\u8a08<\/h2>\n\n\n\n<p>API \u7684\u90e8\u5206\u6211\u523b\u610f\u505a\u6210 OpenAI \u98a8\u683c\uff1a<\/p>\n\n\n\n<p>\u7248\u672c\u5316\u7684 \/v1\/\u2026 \u8def\u5f91\u3001Authorization: Bearer \u7684 token\u3001JSON \u7684 snake_case \u6b04\u4f4d\u3001\u7528 model \u6b04\u4f4d\u9078\u6a21\u578b\u3001\u7d71\u4e00\u7684 response envelope\uff0c\u9023\u932f\u8aa4\u683c\u5f0f\u90fd\u6a21\u4eff OpenAI\u3002\u9019\u6a23\u5927\u5bb6\u4e0a\uff08vibe\uff09\u624b\uff08code\uff09\u8d77\u4f86\u5e7e\u4e4e\u6c92\u6709\u5b78\u7fd2\u6210\u672c\uff0c\u73fe\u6210\u7684 client \u5beb\u6cd5\u7a0d\u5fae\u6539\u4e00\u4e0b\u5c31\u80fd\u7528\u3002\u5982\u679c\u4f60\u9023 HTTP \u90fd\u61f6\u5f97\u8d70\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u628a\u5b83\u7576\u6210 Go library\uff0cimport mod\/* \u90a3\u4e9b package \u5728\u81ea\u5df1\u7684\u7a0b\u5f0f\u88e1\u7576 module \u7528\u3002<\/p>\n\n\n\n<p>\u958b\u767c\u7684\u6642\u5019\u6211\u9084\u505a\u4e86\u4e00\u500b dev \u6a21\u5f0f\uff0cgo run . -dev \u4e4b\u5f8c\u6703\u5728\u700f\u89bd\u5668\u958b\u4e00\u500b\u4e92\u52d5\u5f0f\u7684 API tester\uff1a\u9078\u4efb\u52d9\u3001\u9078\u6a21\u578b\u3001\u8abf\u53c3\u6578\u3001\u4e0a\u50b3\u4e00\u5f35\u672c\u5730\u5716\u7247\uff0c\u7136\u5f8c\u76f4\u63a5\u770b\u5230\u6a19\u8a3b\u597d\u7684 PNG \u8ddf JSON \u56de\u61c9\u3002\u5b83\u751a\u81f3\u6703\u5373\u6642\u5e6b\u4f60\u751f\u51fa\u5c0d\u61c9\u9019\u500b\u8acb\u6c42\u7684 curl \/ fetch \/ jQuery \u7a0b\u5f0f\u78bc\uff0c\u65b9\u4fbf\u4f60\u8cbc\u5230\u81ea\u5df1\u7684\u5c08\u6848\u88e1\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"674\" src=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/segmentation-1024x674.png\" alt=\"\" class=\"wp-image-1451\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/segmentation-1024x674.png 1024w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/segmentation-300x198.png 300w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/segmentation-768x506.png 768w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/segmentation-1200x790.png 1200w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/segmentation.png 1338w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"734\" src=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/pose-1024x734.png\" alt=\"\" class=\"wp-image-1453\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/pose-1024x734.png 1024w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/pose-300x215.png 300w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/pose-768x550.png 768w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/pose.png 1185w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"655\" src=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/classification-1024x655.png\" alt=\"\" class=\"wp-image-1452\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/classification-1024x655.png 1024w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/classification-300x192.png 300w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/classification-768x491.png 768w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/classification-1200x768.png 1200w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2026\/06\/classification.png 1486w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Trade-offs \u8207\u9650\u5236<\/h2>\n\n\n\n<p>\u7576\u7136\uff0c\u7d14 Go + wasm \u4e0d\u662f\u6c92\u6709\u4ee3\u50f9\u7684\uff0c\u6700\u660e\u986f\u7684\u5c31\u662f\u901f\u5ea6\u3002\u7562\u7adf\u4e0d\u662f\u539f\u751f\u57f7\u884c\uff0c\u5728\u908a\u7de3 CPU \u4e0a\u4e00\u5f35\u5716\u505a YOLO11 detection \u5927\u6982\u8981\u4e00\u5169\u79d2\uff0c\u5206\u985e\u5c31\u5feb\u5f88\u591a\uff0cMobileNet \u5927\u6982\u4e09\u3001\u56db\u767e ms\u3002\u5982\u679c\u4f60\u8981\u505a\u5373\u6642\u7684\u4e32\u6d41\u5206\u6790\uff0c\u9019\u500b\u65b9\u6848\u5927\u6982\u4e0d\u9069\u5408\u4f60\u3002\u4f46\u5c0d\u65bc NAS \u5f8c\u53f0\u76f8\u7247\u6574\u7406\u5206\u985e\u9019\u7a2e\u300c\u4e0d\u7528\u5373\u6642\u3001\u6709\u7d50\u679c\u5c31\u597d\u300d\u7684\u5834\u666f\uff0c\u9019\u500b\u901f\u5ea6\u5b8c\u5168\u5920\u7528\uff0c\u800c\u63db\u4f86\u7684\u662f\u96f6\u4f9d\u8cf4\u3001\u55ae\u4e00 binary\u3001\u96a8\u4fbf\u4e1f\u5230\u54ea\u500b\u5e73\u53f0\u90fd\u80fd\u8dd1\u3001\u79fb\u690d\u5b8c\u5168\u4e0d\u7528\u91cd\u65b0\u5f04\u74b0\u5883\u8ddf<s>\u88ab<\/s> <s>python pip \u8ddf apt \u5230\u8655\u62c9\u5c4e<\/s>\uff0c\u600e\u6a23\u770b\u90fd\u662f\u6bd4\u8f03\u597d\u7684\u8a2d\u8a08\uff08\u67b6\u69cb\u6f54\u7656\u767c\u8a00\uff09\u3002<\/p>\n\n\n\n<p>\u9806\u5e36\u4e00\u63d0\uff0c\u5e73\u5e38\u4f7f\u7528\u662f\u4e0d\u9700\u8981\u81ea\u5df1\u7de8 wasm \u7684\uff0c\u56e0\u70ba\u7de8\u597d\u7684 wasm \u5df2\u7d93\u653e\u5728 repo \u88e1\u4e86\uff0cgo build \u5c31\u80fd\u76f4\u63a5\u8dd1\u3002\u53ea\u6709\u4f60\u60f3\u5f9e C \u539f\u59cb\u78bc\u91cd\u65b0\u7de8 wasm \u7684\u6642\u5019\uff08e.g. \u66f4\u65b0 ncnn \u7248\u672c\u4ee5\u652f\u63f4\u65b0\u7684 layers\uff09\uff0c\u624d\u9700\u8981 wasi-sdk \u8ddf ncnn \u7684 webassembly release\uff0c\u6211\u4e5f\u627e Claude \u5beb\u4e86\u4e00\u500b configure.sh \u6703\u81ea\u52d5\u5e6b\u4f60\u4e0b\u8f09\u9019\u5169\u500b SDK\uff0c\u7701\u5f97\u4f60\u624b\u52d5\u53bb\u7ffb release \u9801\u9762\u3002<\/p>\n\n\n\n<p>\u9019\u500b Project \u73fe\u5728\u5c31\u5df2\u7d93\u958b\u6e90\u4e86\uff0c\u6388\u6b0a\u662f BSD 3-Clause\uff0c\u6b61\u8fce\u5927\u5bb6\u62ff\u53bb\u73a9\u3001\u62ff\u53bb\u6539\u3001\u62ff\u53bb\u585e\u9032\u81ea\u5df1\u7684 homelab\u3002\u6709\u8208\u8da3\u7684\u8a71\u6b61\u8fce\u53bb GitHub \u4e0a\u770b\u770b\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/tobychui\/cnnaio\">https:\/\/github.com\/tobychui\/cnnaio<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u8a71\u8aaa\u6211\u7684 homelab \u88e1\u4e00\u76f4\u6709\u500b\u5f88\u9ebb\u7169\u7684\u9700\u6c42\uff1a\u60f3\u5e6b ArozOS \u52a0\u5165\u76f8\u7247\u81ea\u52d5\u5206\u985e\uff0c\u9019\u5176\u5be6\u662f\u5c6c\u65bc\u5f88\u57fa\u672c\u7684 CNN Inference \u529f\u80fd\u3002\u4e4b\u524d ArozOS v2 \u7684\u521d\u671f\u78ba\u5be6\u662f\u6709\u5617\u8a66\u52a0\u5165 darknet + yolo5 \u652f\u63f4\uff0c\u4f46\u662f\u554f\u984c\u662f\u6574\u5305\u6771\u897f\u52a0\u8d77\u4f86\u5feb 250+MB \u4e0d\u6b62\uff0c\u9084\u8981\u6bcf\u6b21\u904b\u4f5c\u90fd\u6703\u628a\u6574\u53f0\u4f3a\u670d\u5668\u7684\u8cc7\u6e90\u5361\u6b7b\uff0c\u8d85\u7d1a\u7121\u6575\u7684\u4e0d\u597d\u7528\uff0c\u6240\u4ee5\u5728\u5f8c\u671f\u7248\u672c\u7684 ArozOS v2 \u5c31\u628a\u9019\u90e8\u5206\u780d\u6389\u4e86\u3002 \u5176\u4ed6 Deployment \u65b9\u6848\uff1f \u78ba\u5be6\u5982\u679c\u662f\u4e0d\u9700\u8981 portable \u7684\u8a71\uff0c\u78ba\u5be6\u6709\u66f4\u5e38\u898b\u7684\u505a\u6cd5\uff0c\u4f8b\u5982 \u53d7\u4e0d\u4e86\u6240\u4ee5\u4f86\u81ea\u5e79\u4e00\u5957 \u6240\u4ee5\u6211\u5c31\u5beb\u4e86\u9019\u500b cnnaio (CNN &#8211; All in one) \u7cfb\u7d71 \u4e00\u53e5\u8a71\u7e3d\u7d50\uff0c\u5b83\u662f\u4e00\u500b\u5168\u90e8\u7528 pure Go \u5beb\u6210\u3001\u96f6\u5916\u90e8\u4f9d\u8cf4\u3001\u55ae\u4e00\u57f7\u884c\u6a94\u7684 CNN Inference RESTFUL API server\u3002\u6c92\u6709 Python\u3001\u6c92\u6709 cgo\u3001\u6c92\u6709 CUDA\u3001\u6c92\u6709\u4efb\u4f55\u7cfb\u7d71 library\uff0c\u9023 model \u6a94\u6848\u90fd\u4e0d\u7528\u53e6\u5916\u5e36\u3002\u4e1f\u5230 Raspberry Pi \u6216\u8005\u4e00\u53f0\u9000\u5f79\u7684 NUC [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,5],"tags":[],"class_list":["post-1448","post","type-post","status-publish","format-standard","hentry","category-ai-tensorflow-machine-learning","category-development-logs"],"_links":{"self":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/1448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1448"}],"version-history":[{"count":3,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/1448\/revisions"}],"predecessor-version":[{"id":1459,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/1448\/revisions\/1459"}],"wp:attachment":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}