{"id":17769,"date":"2022-11-23T10:00:00","date_gmt":"2022-11-23T02:00:00","guid":{"rendered":"https:\/\/www.circuspi.com\/?p=17769"},"modified":"2022-11-23T08:49:43","modified_gmt":"2022-11-23T00:49:43","slug":"pixelbit-%e6%95%99%e5%ad%b8%e5%8d%81%e4%b8%80%ef%bc%8d%e6%95%b4%e5%90%88-azure-custom-vision-%e5%af%a6%e4%bd%9c-edge-ai","status":"publish","type":"post","link":"https:\/\/www.circuspi.com\/index.php\/2022\/11\/23\/pixelbit-%e6%95%99%e5%ad%b8%e5%8d%81%e4%b8%80%ef%bc%8d%e6%95%b4%e5%90%88-azure-custom-vision-%e5%af%a6%e4%bd%9c-edge-ai\/","title":{"rendered":"Pixel:Bit \u6559\u5b78(\u5341\u4e00)\uff0d\u6574\u5408 Azure Custom Vision \u5be6\u4f5c Edge AI"},"content":{"rendered":"\n<p><style>\n\/* ###\u5be6\u9a57\u4e0b\u4e00\u5217### *\/\n\na:link {color:#0695e4\n;}    \/* \u8a2d\u5b9a\u5c1a\u672a\u9ede\u95b1\u904e\u7684\u9023\u7d50\u6a23\u5f0f *\/\na:visited {color:#0695e4\n;} \/* \u8a2d\u5b9a\u904e\u53bb\u66fe\u7d93\u95b1\u904e\u7684\u9023\u7d50 *\/\na:hover {color:#0695e4\n;}   \/* \u8a2d\u5b9a\u6ed1\u9f20\u6e38\u6a19\u6307\u5728\u9023\u7d50\u4f4d\u7f6e\u4e0a\u7684\u6a23\u5f0f *\/\na:active {color:#0000BB;}  \/* \u8a2d\u5b9a\u4e0a\u9ede\u64ca\u904e\u7684\u9023\u7d50\u6a23\u5f0f *\/\n<\/style><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"526\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/11\/1000x526-3.jpg\" alt=\"Pixel:Bit \u6559\u5b78(\u5341\u4e00)\uff0d\u6574\u5408 Azure Custom Vision \u5be6\u4f5c Edge AI\" class=\"wp-image-17906\"\/><\/figure><\/div>\n\n\n\n<p>\u5728\u300c<a href=\"https:\/\/www.circuspi.com\/?s=Azure+Custom+Vision+%E6%95%99%E5%AD%B8\" target=\"_blank\" rel=\"noreferrer noopener\">Azure Custom Vision \u6559\u5b78<\/a>\u300d\u6211\u5011\u4f7f\u7528 Azure Custom Vision \u96f2\u7aef\u670d\u52d9\u5efa\u7acb\u4e86 Classification\u3001Object Detection \u5c08\u6848\uff0c\u4e26\u4e14\u4f7f\u7528\u7dda\u4e0a\u6e2c\u8a66\u5de5\u5177\u4ee5\u53ca\u5c07\u5c08\u6848\u767c\u5e03\uff0c\u4f7f\u7528 REST API \u6e2c\u8a66\u4e86\u6a21\u578b\uff0c\u78ba\u5b9a\u53ef\u4ee5\u9806\u5229\u904b\u4f5c\uff0c\u4eca\u5929\u6211\u5011\u5c07\u4f7f\u7528 MCU Pixel:Bit \u6574\u5408\u5176\u4e2d\u7684 Object Detection \u5c08\u6848\uff0c\u4f7f\u7528 500 \u842c\u756b\u7d20\u76f8\u6a5f\u62cd\u7167\u5f8c\u81ea\u52d5\u547c\u53eb REST API\uff0c\u4e26\u5c07\u56de\u50b3\u7684 Bounding Box\u3001\u540d\u7a31\uff0c\u52a0\u8a3b\u5beb\u5728 TFT \u4e0a\uff0c\u5c31\u8b93\u6211\u5011\u958b\u59cb\u5427\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u6240\u9700\u6750\u6599<\/h2>\n\n\n\n<ul><li><a href=\"https:\/\/www.icshop.com.tw\/product-page.php?28659\" target=\"_blank\" rel=\"noreferrer noopener\">Pixel:Bit<\/a> * 1<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u898f\u5283\u64cd\u4f5c\u6d41\u7a0b<\/h2>\n\n\n\n<ol><li>ready: \u628a camera \u62cd\u651d\u756b\u9762 stream \u5230 TFT<\/li><li>capture: \u7576 button A \u88ab\u6309\u4e0b\uff0c\u5c07\u5f71\u50cf\u8cc7\u6599\u50b3\u5230 Azure API \uff0c\u540c\u6642\u5c07 TFT \u4e2d\u7684\u756b\u9762\u505c\u683c\uff0c\u5f71\u50cf\u8a2d\u5b9a\u70ba 240&#215;240\u3002<\/li><li>predict: \u56de\u50b3\u5f97\u5230\u7684 JSON \u683c\u5f0f\u4e2d\uff0c\u4fe1\u5fc3\u5ea6\u9ad8\u904e\u9580\u6abb\u503c\u8005\uff08\u9810\u8a2d0.75\uff09\uff0c\u5c07 bounding box \u9084\u6709\u540d\u7a31\u52a0\u8a3b\u5beb\u5728 TFT \u756b\u9762\u4e0a\u3002<\/li><li>idle: \u4e0d\u505a\u4efb\u4f55\u52d5\u4f5c\uff0c\u76f4\u5230 button B \u88ab\u6309\u4e0b\uff0c\u5c07\u756b\u9762\u6e05\u9664\u56de\u5230\u7b2c\u4e00\u6b65 ready \u72c0\u614b\u3002<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u5b89\u88dd Arduino Library<\/h2>\n\n\n\n<ul><li><a href=\"https:\/\/github.com\/CIRCUSPi\/CircusEasyUART\" target=\"_blank\" rel=\"noreferrer noopener\">CircusEasyUART<\/a>\uff1aPixel:Bit ESP32 \u8207 ATmega328P \u901a\u8a0a\u7528<\/li><li><a href=\"https:\/\/github.com\/CIRCUSPi\/tca5405\" target=\"_blank\" rel=\"noreferrer noopener\">tca5405<\/a>\uff1aPixel:Bit \u64f4\u5c55 IO \u7528<\/li><li><a href=\"https:\/\/github.com\/CIRCUSPi\/TFT_eSPI\" target=\"_blank\" rel=\"noreferrer noopener\">TFT_eSPI<\/a>\uff1aPixel:Bit TFT \u986f\u793a\u7528<\/li><li><a href=\"https:\/\/github.com\/Bodmer\/TJpg_Decoder\" target=\"_blank\" rel=\"noreferrer noopener\">TJpg_Decoder<\/a>\uff1a\u5c07\u5f71\u50cf Jpg \u89e3\u78bc\u7528<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u4fee\u6539\u8a2d\u5b9a\u6a94<\/h2>\n\n\n\n<p>\u958b\u555f\u4e4b\u524d\u8a13\u7df4\u597d\u7684 Object Detection Project\uff0c\u5207\u63db\u5230 Preformance \u9801\u9762\u9ede\u9078 Prediction URL \u67e5\u770b\u4f60\u7684\u8cc7\u8a0a\uff0c\u5c0d\u7167\u4e0b\u65b9\u683c\u5f0f\uff0c\u66f4\u63db\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\u6a94 config.h \u5167\u7684\u5b9a\u7fa9\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/aMz8KZIsSziGQIx-4w1PszjlNgiUo5XWVJftE9wwcILzu5TSc35kds1GzQNI5R--6Is4hXatLB2DKRzTmaJLfF8xBMn2sxxGFmeSdmfmiG3KcbuUSvoeosImtQj7SZB4tZgo8VejZw7p-OuRAb6yIf_euP42y_xzLTcfQ3OPf_vxR4x9oJ4P5ievhw\" alt=\"Pixel:Bit \u6559\u5b78(\u5341\u4e00)\uff0d\u6574\u5408 Azure Custom Vision \u5be6\u4f5c Edge AI\"\/><\/figure><\/div>\n\n\n\n<p>\u683c\u5f0f\u7bc4\u4f8b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>https:\/\/&lt;API_HOST&gt;\/customvision\/v3.0\/Prediction\/&lt;Prediction_ID&gt;\/detect\/iterations\/&lt;Iterations_ID&gt;\/image<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/_OQMnQZT53_V-nAymWLv6BxJZmwapnRKV0764g_4245w72Fqw9kiejh8rnPLJeDEPpjcFdg8THjxTSY7kNrURN0LwI4tHYlLecwI-sgBBe2I29z_MRjWJiIS-Hz4g3wTK0HPvZmybBCdLatWIksQvX01CVRs5EAVJ90iREeikRluWIBert6mELMJWQ\" alt=\"Pixel:Bit \u6559\u5b78(\u5341\u4e00)\uff0d\u6574\u5408 Azure Custom Vision \u5be6\u4f5c Edge AI\" width=\"767\" height=\"278\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u7a0b\u5f0f\u8aaa\u660e<\/h2>\n\n\n\n<p>\u5efa\u7acb\u8cc7\u6599\u7d50\u69cb\uff0c\u5b58\u653e\u96f2\u7aef\u50b3\u56de\u7684\u8cc7\u6599\uff0cAPI \u56de\u50b3\u7684 boundingBox \u6578\u503c\u90fd\u4ecb\u65bc 0~1\uff0c\u6211\u5011\u9700\u8981\u81ea\u884c\u4f9d\u7167\u767c\u9001\u51fa\u53bb\u7684\u7167\u7247\u89e3\u6790\u5ea6\uff0c\u5c07\u6b64\u6578\u503c\u4e58\u4e0a\u89e3\u6790\u5ea6\u5bec\u8207\u9ad8\u624d\u53ef\u5f97\u5230\u6b63\u78ba\u4f4d\u7f6e\uff0c\u76f8\u95dc\u7a0b\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/Srk1vzYIAzg3PbitfCDSelRfWCTdDIJaFqjGz7KNO9DfQL1RrLr55eE2zn1pEPw8ghJtgOSSwJVXzDYLBpuBKd7Hu-7bOV13YnvocCq8PlkaenIOiQEKOvOh3H3u3oScdImd_dnBm2Mi4Bz6oVAA-R9NcL0FXbT9xt1Ylg1DgduLXKUh2jpIHyjYxw\" alt=\"Pixel:Bit \u6559\u5b78(\u5341\u4e00)\uff0d\u6574\u5408 Azure Custom Vision \u5be6\u4f5c Edge AI\" width=\"784\" height=\"356\"\/><\/figure><\/div>\n\n\n\n<p>\u95dc\u65bc\u5efa\u7acb\u547c\u53eb Azure Prediction API \u65b9\u6cd5\uff0c\u50b3\u5165\u5716\u7247\u8cc7\u6599\u3001\u5716\u7247\u8cc7\u6599\u9577\u5ea6\u7684\u7a0b\u5f0f\u6d41\u7a0b\u5982\u4e0b\u5217\u6b65\u9a5f\uff1a<\/p>\n\n\n\n<ol><li>\u6aa2\u67e5\u53c3\u6578<\/li><li>\u6aa2\u67e5 Wi-Fi \u9023\u7dda\u72c0\u614b<\/li><li>\u4f7f\u7528 HTTPS \u9023\u7dda\u5230 Azure Custom Vision Host<\/li><li>\u8a08\u7b97\u4e26\u986f\u793a\u9023\u7dda\u82b1\u8cbb\u6642\u9593<\/li><li>\u5efa\u7acb HTTP \u5c01\u5305<\/li><li>\u4f7f\u7528 TLS Client \u767c\u9001 HTTP \u5c01\u5305<\/li><li>\u8a08\u7b97\u4e26\u986f\u793a\u767c\u9001\u5c01\u5305\u82b1\u8cbb\u6642\u9593<\/li><li>\u7b49\u5f85 Server \u56de\u50b3\u8cc7\u6599<\/li><li>\u6aa2\u67e5\u9023\u7dda\u4e26\u63a5\u6536\u8cc7\u6599<\/li><li>\u6aa2\u67e5 HTTP Response Code<\/li><li>\u8df3\u904e HTTP Packet Response Header<\/li><li>\u8b80\u53d6 HTTP Response Body \u4e26\u89e3\u6790 Json \u8cc7\u6599\u5b58\u5165 Prediction_t \u7d50\u69cb\u5167<\/li><li>\u95dc\u9589 TLS Client \u9023\u7dda<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/vhZD6YW3SBoZd4d9Pft6WeXEnO_XN4j_fcIrGRvZyRO97KvYSRpAXaiSZJE__U58RI_FIe5GxbLAKh0GJKeqrUQwYrXvXd6OUELF4kdzHKrm6do_eZZFHDCdab2ubVxRaj2H6zxePkm7cV3O-Ez3RWKx-Jmh8j8vVPeUZD37vFr8hL8dtX3SNONI6Q\" alt=\"Pixel:Bit \u6559\u5b78(\u5341\u4e00)\uff0d\u6574\u5408 Azure Custom Vision \u5be6\u4f5c Edge AI\"\/><\/figure><\/div>\n\n\n\n<p>\u800c Arduino Loop Function \u7684\u7a0b\u5f0f\u6d41\u7a0b\u5982\u4e0b\u5217\u6b65\u9a5f\uff1a<\/p>\n\n\n\n<ol><li>\u63a5\u6536 ATmega328P \u8cc7\u6599<\/li><li>READY \u72c0\u614b\u4f7f\u7528 SPI DMA \u4e32\u6d41\u76f8\u6a5f\u756b\u9762\u5230 TFT\u4e0a<\/li><li>\u6309\u4e0b Pixel:Bit A \u6309\u9375\u5f8c\u5c07\u7576\u524d\u5f71\u50cf\u50b3\u5165 AzurePrediction Function<\/li><li>\u4f9d\u7167 AzurePrediction Function Return code \u5c0b\u8a2a\u6240\u6709 Prediction_t Array\uff0c\u4e26\u5c07\u5404\u500b\u7269\u4ef6 boundingBox_t\u3001tagName \u756b\u5728 TFT \u4e0a<\/li><li>\u8a08\u7b97\u4e26\u986f\u793a\u7e3d\u82b1\u8cbb\u6642\u9593<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/qShOp-XS8nS338eTm0h3vJ68toTzTF5ylYZb0LZuLyOAg2H_ov2VlbslkjFx31xf5QuZqrJK-8diN6Qf049r9u-sq1pdKWDPNy5JWB-JVzg3aX9rj_xdKbJyG6j3STmWnSRZ8VEF6MpB5ZlklkT6wquxfWSxud-thtV9h9frMGe8It2YkaP6shY3cQ\" alt=\"Pixel:Bit \u6559\u5b78(\u5341\u4e00)\uff0d\u6574\u5408 Azure Custom Vision \u5be6\u4f5c Edge AI\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u9a57\u8b49<\/h2>\n\n\n\n<p>\u9810\u8a2d\u76f8\u6a5f\u5f71\u50cf\u4e32\u6d41\u5230 TFT \u986f\u793a\uff0c\u6309\u4e0b A \u9375\u5c07\u5f71\u50cf\u767c\u9001\u5230 Azure Custom Vision \u63a8\u8ad6\uff0c\u4e26\u5c07\u56de\u50b3\u8cc7\u6599\u986f\u793a\u7e6a\u88fd\u5728 TFT \u4e0a\uff0c\u6309\u4e0b B \u9375\u7e7c\u7e8c\u4e32\u6d41\u5f71\u50cf\u5230 TFT \u986f\u793a\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/D8BO82RK35uQLS8_VyVsvbmgNEP2dJatY02IyDdcFezYoLho4e88SZP-2D-APTAkZ8vw8pPuEltmZCh_zDIfsCLv7Xb7x170UmsUcUwRTM_N5TfdryopJosLEfHEli0oHFGirT46o54xHVFBrQ1P6nRJHL-3CHLXdary9XrT9gzThjA8L1B9fyp1Zw\" alt=\"Pixel:Bit \u6559\u5b78(\u5341\u4e00)\uff0d\u6574\u5408 Azure Custom Vision \u5be6\u4f5c Edge AI\" width=\"674\" height=\"505\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u5c0f\u7d50<\/h2>\n\n\n\n<p>\u4ee5\u4e0a\u5c31\u662f\u5c07 Azure Custom Vision \u7d50\u5408\u5230 Pixel:Bit \u7684\u904e\u7a0b\uff0c\u7d93\u904e\u591a\u6b21\u6e2c\u8a66\u5f8c\u5e73\u5747\u55ae\u6b21\u767c\u9001\u5230\u56de\u50b3\u6642\u9593\u70ba 2.7 \u79d2\uff0c\u8207\u300cAzure Custom Vision \u6559\u5b78(\u4e09)\u300d\u4f7f\u7528\u96fb\u8166 Postman \u547c\u53eb API \u6bd4\u8d77\u4f86\u591a\u4e86\u5c07\u8fd1\u4e00\u500d\u7684\u6642\u9593\uff0c2.7 s\/FPS\uff0c\u5982\u679c\u60f3\u8981\u505a\u5230\u6642\u5be6\u8fa8\u8b58\u770b\u8d77\u4f86\u662f\u6bd4\u8f03\u6c92\u6709\u6a5f\u6703\uff0c\u4f46\u662f\u5c0d\u65bc\u4e00\u4e9b\u4e0d\u9700\u8981\u5373\u6642\u8fa8\u8b58\u53c8\u60f3\u8981\u5be6\u73fe\u7269\u4ef6\u8fa8\u8b58\u7684\u5834\u5408\u9084\u662f\u883b\u6709\u7528\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u6211\u5011\u5c07\u4f7f\u7528 MCU Pixel:Bit \u6574\u5408\u5176\u4e2d\u7684 Object Detection \u5c08\u6848\uff0c\u4f7f\u7528 500 \u842c\u756b\u7d20\u76f8\u6a5f\u62cd\u7167\u5f8c\u81ea\u52d5\u547c\u53eb REST API\uff0c\u4e26\u5c07\u56de\u50b3\u7684 Bounding Box\u3001\u540d\u7a31\uff0c\u52a0\u8a3b\u5beb\u5728 TFT \u4e0a\u3002<\/p>\n","protected":false},"author":1,"featured_media":17907,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[274,238],"tags":[],"table_tags":[],"_links":{"self":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/17769"}],"collection":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/comments?post=17769"}],"version-history":[{"count":7,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/17769\/revisions"}],"predecessor-version":[{"id":17909,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/17769\/revisions\/17909"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/media\/17907"}],"wp:attachment":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/media?parent=17769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/categories?post=17769"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/tags?post=17769"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/table_tags?post=17769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}