{"id":11463,"date":"2021-06-23T17:37:23","date_gmt":"2021-06-23T09:37:23","guid":{"rendered":"http:\/\/www.circuspi.com\/?p=11463"},"modified":"2022-08-26T15:58:49","modified_gmt":"2022-08-26T07:58:49","slug":"ai-mediapipe-unit2","status":"publish","type":"post","link":"https:\/\/www.circuspi.com\/index.php\/2021\/06\/23\/ai-mediapipe-unit2\/","title":{"rendered":"\u4e00\u8d77\u5b78AI\uff01MediaPipe\u61c9\u7528\u6559\u5b78-\u55ae\u5143(\u4e8c)\u4eba\u81c9\u6aa2\u6e2c"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"3001\" height=\"1580\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2021\/06\/C_02.jpg\" alt=\"\" class=\"wp-image-11879\"\/><\/figure>\n\n\n\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<h2 class=\"wp-block-heading\">\u4e00\u3001\u7c21\u4ecb<\/h2>\n\n\n\n<p>\u4e0a\u4e00\u500b\u55ae\u5143\u6559\u5927\u5bb6\u5982\u4f55\u5b89\u88dd <a rel=\"noreferrer noopener\" href=\"https:\/\/google.github.io\/mediapipe\/\" target=\"_blank\">MediaPipe<\/a>\uff0c\u76f8\u4fe1\u60a8\u5df2\u7d93\u77e5\u9053\u5982\u4f55\u5728\u865b\u64ec\u74b0\u5883\u4e2d\u4e0b\u6307\u4ee4\uff0c\u82e5\u662f\u6709\u770b\u5230\u6700\u5f8c\u7684\u540c\u5b78\uff0c\u60a8\u61c9\u8a72\u4e5f\u6e96\u5099\u597d\u7a0b\u5f0f\u7de8\u8f2f\u5668\u4e86\u5c0d\u55ce\uff1f\u9084\u662fWindows \u8a18\u4e8b\u672c\uff1f<\/p>\n\n\n\n<p>\u4e0d\u7ba1\u662f\u54ea\u4e00\u500b\uff0c\u5728\u9019\u500b\u55ae\u5143\u6211\u5011\u5c07\u958b\u59cb\u9032\u5165\u6b63\u984c\uff0c\u5e36\u5927\u5bb6\u4e00\u8d77\u4f86\u770b\u770b <a rel=\"noreferrer noopener\" href=\"https:\/\/google.github.io\/mediapipe\/\" target=\"_blank\">MediaPipe<\/a>\u5b98\u65b9\u7db2\u7ad9\u91dd\u5c0d\u6bcf\u500b\u529f\u80fd\uff0c\u6240\u63d0\u4f9b\u7684\u7bc4\u4f8b\u7a0b\u5f0f\u3002<\/p>\n\n\n\n<p>\u5594\uff5e\u5c0d\u4e86\uff0c\u6211\u5011\u9084\u9700\u8981\u6e96\u5099\u4e00\u500b\u651d\u5f71\u6a5f\uff0c\u4e00\u822c\u7684<a href=\"https:\/\/www.icshop.com.tw\/product-page.php?27870\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"WebCam (opens in a new tab)\">WebCam<\/a>\u5c31\u53ef\u4ee5\u4e86\uff0c\u82e5\u662f\u60a8\u4f7f\u7528\u7684\u662f\u7b46\u8a18\u578b\u96fb\u8166(\u672c\u8eab\u6709\u914d\u5099\u8996\u8a0a\u651d\u5f71\u6a5f)\u5c31\u4e0d\u7528\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u64cd\u4f5c\u6d41\u7a0b<\/h2>\n\n\n\n<p>\u555f\u52d5\u4e00\u500b\u7a0b\u5f0f\u7684\u6d41\u7a0b\uff0c\u6211\u5011\u900f\u904e\u4e0b\u9762\u9019\u4e00\u5f35\u5716\u7247\u70ba\u5927\u5bb6\u7c21\u8ff0\uff0c\u5df2\u7d93\u77e5\u9053\u5982\u4f55\u958b\u555f\u4e26\u57f7\u884c\u7a0b\u5f0f\u7684\u670b\u53cb\uff0c\u53ef\u4ee5\u8df3\u904e\u9019\u4e00\u6bb5\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/ARUAjx9odq2LMgKrc_nYJLaSVEJv_D8YGOC9zC25acSX2kTzCqryuU9rz0sXZe4vxdd5rAfVPDTuNzajHbh0KGz12KEInaQIxKgn-SKzBpQOb28i44Ne2TJh9bYNTC7J6INaBGFl\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u9996\u5148\u6211\u5011\u5148\u8907\u88fd\u7bc4\u4f8b\u7a0b\u5f0f\u5230\u7a0b\u5f0f\u7de8\u8f2f\u5668\uff0c\u5c07\u5b83\u5132\u5b58\u6210Python \u7684\u6a94\u6848\uff0c\u518d\u900f\u904e\u7d42\u7aef\u6a5f\u9032\u5230\u865b\u64ec\u74b0\u5883\u5f8c\uff0c\u4e0b\u6307\u4ee4\u555f\u52d5\u525b\u525b\u5132\u5b58\u7684Python\u6a94\u6848\u3002<\/p>\n\n\n\n<p>\u9084\u662f\u770b\u4e0d\u61c2\uff1f\u5f85\u6703\u5152\u6211\u5011\u6703\u4e00\u6b65\u4e00\u6b65\u5e36\u5927\u5bb6\u64cd\u4f5c\uff0c\u8acb\u4e0d\u8981\u64d4\u5fc3\uff0c\u8b93\u6211\u5011\u76f4\u63a5\u958b\u59cb\u4eca\u5929\u7684\u4e3b\u984c\u5427\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u4eba\u81c9\u6aa2\u6e2c<\/h2>\n\n\n\n<p><a href=\"https:\/\/google.github.io\/mediapipe\/solutions\/face_detection#python-solution-api\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">MediaPipe Face Detection<\/a>\u662f\u4e00\u500b\u8d85\u5feb\u7684\u4eba\u81c9\u6aa2\u6e2c\u65b9\u6cd5\uff0c\u900f\u904e6\u500b\u9ede\u5b9a\u4f4d\u4eba\u7684\u81c9\u90e8\uff0c\u5206\u5225\u662f\u53f3\u773c\u3001\u5de6\u773c\u3001\u9f3b\u5b50\u3001\u5634\u5df4\u4e2d\u592e\u3001\u9760\u8fd1\u53f3\u8033\u81c9\u908a\u8207\u9760\u8fd1\u5de6\u8033\u81c9\u908a\u3002\u4e26\u652f\u63f4\u6aa2\u6e2c\u591a\u500b\u4eba\u81c9\uff0c\u5176\u7b97\u6cd5\u57fa\u65bc BlazeFace\uff0c\u9019\u662f\u4e00\u7a2e\u8f15\u91cf\u7d1a\u4e14\u6027\u80fd\u826f\u597d\u7684\u4eba\u81c9\u6aa2\u6e2c\u5668\uff0c\u4e14\u975e\u5e38\u9069\u5408\u884c\u52d5\u88dd\u7f6e\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/HCkNTQHA43bVwFVXid-evRkmTXK5I3do07Z6mgeavxtsYmAKPnQg0CaLF7RjFPjZThXGG1uw8yopWP91RaCXV_5RQ0ZUdoCDMRNAYo35pqSDdo_5M3f2IQdbJFcU_g_K2uI5AUpX\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u4e0a\u5716\u7528\u4e86\u865b\u64ec\u66ff\u8eab\u4f86\u8b93\u7a0b\u5f0f\u6aa2\u6e2c\u770b\u770b\uff0c\u9084\u771f\u7684\u6709\u6846\u9078\u5230\u5462\uff5e\u96d6\u8aaa\u6709\u4e9b\u6a19\u8a3b\u9ede\u6b6a\u6b6a\u7684\uff0c\u4f46\u9762\u5c0d\u6211\u7684\u60e1\u641e\uff0c\u5b83\u8868\u73fe\u5f97\u5f88\u68d2\u3002\u5927\u81f4\u4e0a\u77e5\u9053\u300c\u4eba\u81c9\u6aa2\u6e2c\u300d\u80fd\u505a\u4ec0\u9ebc\u4e4b\u5f8c\uff0c\u8b93\u6211\u5011\u9032\u5230\u4e0b\u4e00\u500b\u74b0\u7bc0\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u57fa\u790e\u7a0b\u5f0f\u78bc\u4e0b\u8f09<\/h2>\n\n\n\n<p>1. \u9996\u5148\u900f\u904e\u4e0b\u5217\u9023\u7d50\uff0c\u9032\u5230\u7a0b\u5f0f\u78bc\u6240\u5728\u7684\u9801\u9762\u3002<\/p>\n\n\n\n<p><strong><a rel=\"noreferrer noopener\" aria-label=\"\u7a0b\u5f0f\u78bc\u9023\u7d50\n (opens in a new tab)\" href=\"https:\/\/github.com\/iCShopMgr\/MediaPipe_Example\/blob\/main\/face.py\" target=\"_blank\">\u7a0b\u5f0f\u78bc\u9023\u7d50<\/a><\/strong><\/p>\n\n\n\n<p>2. \u63a5\u8457\u8907\u88fd\u7db2\u9801\u4e0a\u7684\u7a0b\u5f0f\u78bc\u81f3\u81ea\u5df1\u7684\u7a0b\u5f0f\u7de8\u8f2f\u5668\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/SM6JP-z846UAibBzBeFioILEcO4U2TC0wGsof3_Dex2qqjfvXrpK21_lvQ6v_UJIeInBJP_1yX2AFI6ehm86iXo3p8Pk8GKJVAqoRKMEMs58JQ5b_zgjbQZcPzn8YNCKm4mhZsiE\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>3. \u900f\u904e\u7a0b\u5f0f\u7de8\u8f2f\u5668\u5132\u5b58\u6a94\u6848\uff0c\u5132\u5b58\u6a94\u6848\u7684\u6a94\u540d\u53ef\u4ee5\u96a8\u4fbf\u6253\uff0c\u4f46\u5f8c\u65b9\u9700\u52a0\u4e0a\u300c<strong>.py<\/strong>\u300d\uff0c\u9019\u662f\u526f\u6a94\u540d\u7684\u90e8\u4efd\uff0c\u4ee3\u8868\u9019\u662f\u4ec0\u9ebc\u683c\u5f0f\u7684\u6a94\u6848\uff0c\u300c<strong>.py<\/strong>\u300d\u8868\u793a\u9019\u500b\u6a94\u6848\u662fPython\u8a9e\u8a00\u7684\u6a94\u6848\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u5716\u8209\u4f8b\uff0c\u5c0f\u7de8\u7684\u6a94\u6848\u540d\u7a31\u60f3\u53d6\u540d\u53eb\u300c<strong>face<\/strong>\u300d\uff0c\u90a3\u9ebc\u5132\u5b58\u7684\u6a94\u6848\u540d\u7a31\u5247\u70ba\u300c<strong>face.py<\/strong>\u300d\u3002\u53d6\u5b8c\u540d\u7a31\u5f8c\uff0c\u9078\u64c7\u60f3\u8981\u5132\u5b58\u7684\u5730\u65b9\uff0c\u4e26\u6309\u4e0b\u5b58\u6a94\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/0VPhA4lCCW_D5Jq5sF2xqnNypKfZji-gpRLA9XPlhseTRebHbVAg2paYEUNFJ4DQo3DjcARkgbXO3H5TaRwPD2ZZgTGYheR0p91S2JK20C1B8JlQGuTzIyna_vNuD8NkjB6cHH5o\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u7d42\u7aef\u6a5f\u57fa\u790e\u64cd\u4f5c<\/h2>\n\n\n\n<p>\u63a5\u8457\u8b93\u6211\u5011\u555f\u52d5\u865b\u64ec\u74b0\u5883\uff0c\u5fd8\u8a18\u7684\u540c\u5b78\u53ef\u4ee5\u56de\u5230\u4e0a\u4e00\u500b\u55ae\u5143\u300c<mark> MediaPipe \u61c9\u7528\u6559\u5b78-\u55ae\u5143(\u4e00)\u74b0\u5883\u8a2d\u5b9a <\/mark>\u300d\u67e5\u770b\uff0c\u8a18\u5f97\u8981\u78ba\u8a8d\u958b\u982d\u662f\u5426\u6709\u5f9e<strong>(base)<\/strong>\u8f49\u8b8a\u6210\u81ea\u5df1\u7684<strong>\u865b\u64ec\u74b0\u5883\u540d\u7a31<\/strong>\u5594\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/mMXr_CSvoHPkDFb6IZg8TueNmFk8HA32LgtODDrXbYnXQM7smOR8gH26VHWyxNx5_5j9yt-zHk-iWGkXvhZPmAq613bFcj_r5HyHpuCrQOSbhHJJe4QpgnuvvHpLZUAZs4Tpf1l6\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u9032\u5230\u865b\u64ec\u74b0\u5883\u4e4b\u5f8c\uff0c\u6211\u5011\u5c07\u900f\u904e\u6307\u4ee4\u9032\u5230\u7a0b\u5f0f\u6a94\u6848\u6240\u5728\u7684\u8cc7\u6599\u593e\uff0c\u4e26\u958b\u555f\u7a0b\u5f0f\u78bc\u8b93\u5b83\u57f7\u884c\u3002\u56e0\u70ba\u5728\u7d42\u7aef\u6a5f\u7684\u4e00\u5207\u52d5\u4f5c\u90fd\u9700\u8981\u6307\u4ee4\uff0c\u6240\u4ee5\u5c31\u4f86\u6559\u5927\u5bb6\u5169\u500b\u5e38\u7528\u7684\u6307\u4ee4\u3002<\/p>\n\n\n\n<p><strong>\u7b2c\u4e00\u500b\u6307\u4ee4<\/strong>\u662f\u5217\u51fa\u76ee\u9304\u5e95\u4e0b\u7684\u9805\u76ee\u7528\u7684\uff0c\u5728Windows\u662f\u7528\u300c<strong>dir<\/strong>\u300d\uff0cLinux\u5247\u662f\u7528\u300c<strong>ls<\/strong>\u300d\uff0c\u610f\u601d\u90fd\u662f\u4e00\u6a23\u7684\u3002<\/p>\n\n\n\n<p>\u4ee5Windows\u96fb\u8166\u70ba\u4f8b\uff0c\u300c<strong>dir<\/strong>\u300d\u6307\u4ee4\u5168\u6587\u662fdirectory\uff0c\u9019\u500b\u6307\u4ee4\u53ef\u4ee5\u5217\u51fa\u60a8\u6240\u5728\u4f4d\u5b50\u5e95\u4e0b\u7684\u6240\u6709\u6a94\u6848\u8207\u8cc7\u6599\u593e\uff0c\u8b93\u6211\u5011\u8f38\u5165\u9019\u500b\u6307\u4ee4\u4e26\u6309\u4e0b\u300c<strong>Enter<\/strong>\u300d\u770b\u770b\u3002<\/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\/kA_S3VxT3ej2uGtdmp8lu0N5J8oYXJJv8pHmrje3WTNkQU-ELwCy7XE9l4vEZxfZFjaAtYiO1aowlnvTsoy0b-MECcRvsgPJ4jo3plWxIaDRd_fQoloEhJdXTViuWO89OBavjKIn\" alt=\"\" width=\"883\" height=\"463\"\/><\/figure><\/div>\n\n\n\n<p>\u5982\u4e0a\u5716\u6240\u793a\uff0c\u5217\u51fa\u4e86\u5c0f\u7de8\u76ee\u524d\u7d42\u7aef\u6a5f\u6240\u5728\u7684\u4f4d\u7f6e\u300c<strong>C:\\Users\\iCShop<\/strong>\u300d\u5e95\u4e0b\u7684\u6240\u6709\u8cc7\u6599\u3002\u6211\u5011\u53ef\u4ee5\u6253\u958b\u540c\u6a23\u4f4d\u7f6e\u7684\u8cc7\u6599\u593e\u5c0d\u7167\u770b\u770b\u3002<\/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\/EmnMK2W2pL0q7_TN9PpnZfIOyieah-QN8C399la0bCTPBlg3H6GwJlqgf2cekdSjXcyY-2vK0w-Oz-Py7RMloBAI8EnktFu9RGi_RxmPz-DSeYjsSBPcJAXDsm-wQ8-0vAwq-xL1\" alt=\"\" width=\"882\" height=\"399\"\/><\/figure><\/div>\n\n\n\n<p>\u300c<strong>\u4e0b\u6307\u4ee4<\/strong>\u300d\u4e4d\u807d\u4e4b\u4e0b\u597d\u50cf\u5f88\u8907\u96dc\u53c8\u56f0\u96e3\uff0c\u4f46\u7fd2\u6163\u4e4b\u5f8c\uff0c\u5176\u5be6\u53ea\u662f\u7528\u4e0d\u540c\u7684\u65b9\u5f0f\u5728\u505a\u540c\u6a23\u7684\u4e8b\u800c\u5df2\u3002<\/p>\n\n\n\n<p><strong>\u7b2c\u4e8c\u500b\u6307\u4ee4<\/strong>\u662f\u79fb\u52d5\u5230\u5225\u7684\u8cc7\u6599\u593e\u7528\u7684\uff0c\u5728Windows\u8207Linux\u96fb\u8166\u4e0a\u90fd\u4e00\u6a23\uff0c\u9019\u500b\u6307\u4ee4\u53eb\u300c<strong>cd<\/strong>\u300d\uff0c\u5168\u6587\u662fChange Directory\uff0c\u529f\u80fd\u5c31\u662f\u7528\u4f86\u300c<strong>\u5207\u63db\u5de5\u4f5c\u76ee\u9304<\/strong>\u300d\uff0c\u8b93\u60a8\u5728\u7d42\u7aef\u6a5f\u81ea\u7531\u7a7f\u68ad\u5176\u4ed6\u5730\u65b9\u3002<\/p>\n\n\n\n<p>\u5728\u525b\u525b\u4e0b\u5b8c\u300c<strong>dir<\/strong>\u300d\u6307\u4ee4\u5217\u51fa\u4f86\u7684\u76ee\u9304\u6e05\u55ae\u4e2d\uff0c\u56e0\u8a72\u53ef\u4ee5\u627e\u5230\u4e00\u500b\u300c<strong>Desktop<\/strong>\u300d\u7684\u540d\u7a31\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/piQsRpNdDcd0osmU2tR6MfJpl9j3tI5E7B2syO9i_j-Yu3xrG54prtrvvbj5QO48V3pnUm89_0rDW0kzYiM4wRpVqzwT-rB4-QklJ3VgT6CIrMRdAhHWV6hK0CtaOhwIaDEtM6pn\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u8b93\u6211\u5011\u8a66\u8457\u7528\u300c<strong>cd<\/strong>\u300d\u6307\u4ee4\u5f9e\u73fe\u5728\u7684\u4f4d\u5b50\u79fb\u52d5\u5230\u300c<strong>Desktop<\/strong>\u300d\u3002\u4e0b\u6307\u4ee4\u7684\u65b9\u5f0f\u5f88\u7c21\u55ae\uff0c\u8f38\u5165\u5b8ccd\u5f8c\u7a7a\u4e00\u683c\uff0c\u518d\u8f38\u5165\u8981\u524d\u5f80\u7684\u76ee\u6a19Desktop\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/rJnuBd86UGhcPSe9YVq6fQKjnRTwBmzAEnIuJIeuvtpAl_956Dqp0tBvBTzPCdPuhtmKWMc4fJPKFUXzSe6oZ2U_o621LXscF-dXKnge5JkM971evwT15700pszoW3sGFMHl5ymA\" alt=\"\" width=\"757\" height=\"447\"\/><\/figure><\/div>\n\n\n\n<p>A. \u547c\u53eb\u300c<strong>cd<\/strong>\u300d\u6307\u4ee4\u6e96\u5099\u79fb\u52d5\u3002<\/p>\n\n\n\n<p>B. \u5728\u8f38\u5165\u8981\u79fb\u52d5\u7684\u8cc7\u6599\u593e\u540d\u7a31\u524d\u9700\u8981\u7a7a\u4e00\u683c\u3002<\/p>\n\n\n\n<p>C. \u60f3\u8981\u524d\u5f80\u7684\u8cc7\u6599\u593e\u540d\u7a31\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-style-default\"><p><strong>\u5c0f\u6487\u6b65<\/strong><\/p><cite><strong>\u8a66\u8457\u5728\u8f38\u5165\u8cc7\u6599\u593e\u540d\u7a31\u8f38\u5165\u4e00\u534a\u7684\u6642\u5019\uff0c\u6309\u4e0b\u9375\u76e4\u4e0a\u7684\u300cTab\u300d\u6309\u9375\uff0c\u82e5\u662f\u76ee\u524d\u8f38\u5165\u7684\u6587\u5b57\u5728\u8cc7\u6599\u593e\u4e2d\u6c92\u6709\u540c\u6a23\u540d\u7a31\u7684\u8a71\uff0c\u7d42\u7aef\u6a5f\u6703\u5e6b\u60a8\u8f38\u5165\u5f8c\u7e8c\u7684\u90e8\u4efd\u5466\uff01<\/strong> <\/cite><\/blockquote>\n\n\n\n<p>\u8f38\u5165\u5b8c\u6210\u5f8c\u6309\u4e0b\u300c<strong>Enter<\/strong>\u300d\uff0c\u5982\u4e0b\u5716\u6240\u793a\uff0c\u5c31\u6703\u767c\u73fe\u8def\u5f91\u6709\u6539\u8b8a\u4e86\u5466\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/7O8wMx6Wt4VyJamalutVN2b1k0x_gIBmyvM9m41DMrZQvK91Nfv9r6xrxfBBUBuYbWYNRoBZnkMDRzKxJVWrZg9jtoYGv90nx2n9TXcUbK2nF13aK6fRNeXK4BEOb9RuwsxJ-4vX\" alt=\"\" width=\"846\" height=\"535\"\/><\/figure><\/div>\n\n\n\n<p>\u6709\u524d\u9032\u5230\u4e0b\u4e00\u500b\u8cc7\u6599\u593e\u7684\u6307\u4ee4\uff0c\u7576\u7136\u4e5f\u6709\u56de\u5230\u4e0a\u4e00\u500b\u8cc7\u6599\u593e\u7684\u6307\u4ee4\u56c9\uff0c\u9019\u500b\u6307\u4ee4\u662f\u300c<strong>cd ..<\/strong>\u300d\uff0c\u9019\u500b\u6307\u4ee4\u53ef\u4ee5\u8b93\u60a8\u56de\u5230\u4e0a\u4e00\u500b\u76ee\u9304\u3002<\/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\/V138UmlHwyArtuvhZJlYPa4REyTrnZR6lAG2NHeHl4u1NMq_HnDFX3PgUSxFX3EKq0ApHkhjU478uey5Mv6jzfPVmuWW3wg2X9l3MDLV3i-UHZUxCr175ni8l8yCVY-WI469vQdL\" alt=\"\" width=\"853\" height=\"539\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u57f7\u884c\u7a0b\u5f0f<\/h2>\n\n\n\n<p>\u63a5\u8457\u8b93\u6211\u5011\u99ac\u4e0a\u7528\u525b\u525b\u5b78\u7684\u6307\u4ee4\u4f86\u8a66\u8a66\u770b\uff0c\u8acb\u79fb\u52d5\u5230\u60a8\u525b\u525b\u5b58\u653ePython\u7a0b\u5f0f\u6a94\u6848\u300c<strong>\u6240\u5728\u7684\u4f4d\u7f6e<\/strong>\u300d\u3002<\/p>\n\n\n\n<p>\u4ee5\u5c0f\u7de8\u70ba\u4f8b\uff0c\u525b\u525b\u6211\u5c07\u300c<strong>face.py<\/strong>\u300d\u5b58\u653e\u5728\u684c\u9762\u7684\u4e00\u500b\u540d\u70bamediapipe\u7684\u8cc7\u6599\u593e\u88e1\uff0c\u8def\u5f91\u5c31\u662f\u300c<strong>C:\\Users\\iCShop\\Desktop\\mediapipe<\/strong>\u300d\u3002<\/p>\n\n\n\n<p>\u4f9d\u7167\u525b\u525b\u6240\u6559\u7684\u300c<strong>cd<\/strong>\u300d\u6307\u4ee4\uff0c\u79fb\u52d5\u5230\u5b58\u653ePython\u7a0b\u5f0f\u6a94\u6848\u7684mediapipe\u8cc7\u6599\u593e\u88e1\uff0c\u4e26\u900f\u904e\u300c<strong>dir<\/strong>\u300d\u6307\u4ee4\u5217\u51fa\u76ee\u9304\u4f86\u6aa2\u67e5\uff0c\u5982\u4e0b\u5716\u6240\u793a\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/V6kTDiP5drXa0ZiVIeTMO-61vV6pxO9pi5OMgYzjW8DoJu4_EeRrIL-OpusGEN1LvsONH7D4gokete0B1DLNWHd0oWPz25ijV073svk5t7dMFtI2-XMIgr8r4KKejh2YsJlDGirC\" alt=\"\" width=\"867\" height=\"548\"\/><\/figure><\/div>\n\n\n\n<p>\u63a5\u8457\u8b93\u6211\u5011\u900f\u904e\u57f7\u884cPython\u6a94\u6848\u7684\u6307\u4ee4\uff0c\u4f86\u958b\u555f\u6a94\u6848\u57f7\u884c\u6211\u5011\u7684\u7a0b\u5f0f\u78bc\u3002\u9996\u5148\u662f\u8f38\u5165\u300c<strong>python<\/strong>\u300d\uff0c\u900f\u904e\u9019\u500b\u6307\u4ee4\u4f86\u547c\u53eb\u6211\u5011\u8981\u57f7\u884c\u7684Python\u7a0b\u5f0f\u6a94\u6848\uff0c\u63a5\u8457\u7a7a\u4e00\u683c\u518d\u8f38\u5165\u8981\u57f7\u884c\u7684\u6a94\u6848\u540d\u7a31\u4e26\u5305\u542b\u526f\u6a94\u540d\u300c<strong>.py<\/strong>\u300d\uff0c\u5982\u4e0b\u5716\u8aaa\u660e\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/iDTP32rgblJcn7XUn_iEZrMkSo5dnXIDr5VtaFsE0j9d4vkn5_b_Gf96OJ61RRZyGxRU7-RlSE2L4BUhNBKBBbkM4MvwlXFSQJQdbOyiYWia4AvsuPEXEG8slzzuBY--T6ZeEa0z\" alt=\"\" width=\"865\" height=\"524\"\/><\/figure><\/div>\n\n\n\n<p>A. \u547c\u53eb\u300c<strong>python<\/strong>\u300d\u6307\u4ee4\u6e96\u5099\u57f7\u884c\u7a0b\u5f0f\u3002<\/p>\n\n\n\n<p>B. \u5728\u8f38\u5165\u8981\u57f7\u884c\u7684\u6a94\u6848\u540d\u7a31\u524d\u9700\u8981\u7a7a\u4e00\u683c\u3002<\/p>\n\n\n\n<p>C. \u8f38\u5165\u8981\u57f7\u884c\u7684\u6a94\u6848\u540d\u7a31\u5305\u542b.py\u3002<\/p>\n\n\n\n<p>\u8f38\u5165\u5b8c\u6210\u5f8c\u6309\u4e0b\u300c<strong>Enter<\/strong>\u300d\uff0c\u57f7\u884c\u904e\u7a0b\u4e2d\u6c92\u6709\u554f\u984c\u7684\u8a71\uff0c\u6703\u81ea\u52d5\u958b\u555f\u651d\u5f71\u6a5f\uff0c\u4e26\u8df3\u51fa\u986f\u793a\u8996\u7a97\u958b\u59cb\u6aa2\u6e2c\u4eba\u81c9\uff0c\u5982\u4e0b\u5716\u6240\u793a\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/Wyq5YZucsObimknibYBhpT0tDnnwMIMO20ou049as3sO90up0e5EHtXUq33G7KetOFmdQUVr_df8wwPgxxzMBk4HGHl-i0-EqELxtQCdRJQsEJRHltqWQL1vvOqOiEzLrFyZMxPM\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u5de6\u53f3\u64fa\u52d5\u770b\u770b\uff0c\u6216\u662f\u627e\u670b\u53cb\u4e00\u8d77\u5165\u93e1\uff0c\u770b\u770b\u662f\u5426\u6709\u6846\u9078\u5230\u4f60\u5011\u7684\u81c9\u3002<\/p>\n\n\n\n<p>\u82e5\u8981\u7d50\u675f\u7a0b\u5f0f\uff0c\u8acb\u5148\u9ede\u9078\u986f\u793a\u756b\u9762\u7684\u8996\u7a97\uff0c\u518d\u6309\u4e0b\u9375\u76e4\u4e0a\u7684\u300c<strong>Esc<\/strong>\u300d\u6309\u9375\uff0c\u9019\u6a23\u5c31\u53ef\u4ee5\u95dc\u9589\u7a0b\u5f0f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u7a0b\u5f0f\u78bc\u7c21\u95b1<\/h2>\n\n\n\n<p>\u525b\u525b\u57f7\u884c\u7684\u4eba\u81c9\u6aa2\u6e2c\u529f\u80fd\u90fd\u662f\u900f\u904e\u7a0b\u5f0f\u78bc\u6240\u5be6\u73fe\u7684\uff0c\u8b93\u6211\u5011\u7c21\u55ae\u7684\u4f86\u770b\u4e00\u4e0b\uff0c\u7a0b\u5f0f\u78bc\u505a\u4e86\u4e9b\u4ec0\u9ebc\u5427\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u532f\u5165\u6a94\u6848<\/h3>\n\n\n\n<p>\u9996\u5148\u532f\u5165\u6211\u5011\u9700\u8981\u7684\u529f\u80fd\uff0c\u5f71\u50cf\u8655\u7406\u5957\u4ef6\u300c<strong>cv2(OpenCV)<\/strong>\u300d\u8207\u6211\u5011\u7684\u4e3b\u89d2\u300c<strong>mediapipe<\/strong>\u300d\u4e26\u5728\u7a0b\u5f0f\u78bc\u88e1\u5c07\u5b83\u7c21\u7a31\u70ba\u300cmp\u300d\u3002<\/p>\n\n\n\n<p>\u63a5\u8457\u53d6\u51fa\u300c<strong>mediapipe<\/strong>\u300d\u529f\u80fd\u767e\u5bf6\u888b\u300c<strong>solutions<\/strong>\u300d\u88e1\u9762\u7684\u300c<strong>\u4eba\u81c9\u6aa2\u6e2c\u65b9\u6cd5<\/strong>\u300d\u8207\u300c<strong>\u7e6a\u5716\/\u6a19\u8a3b\u65b9\u6cd5<\/strong>\u300d\u3002\u4e26\u5c07\u9019\u4e9b\u65b9\u6cd5\u8ce6\u4e88\u65b0\u7684\u540d\u7a31\u5099\u7528\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/2deaQmRvcYtYQ_u34q-fEOQiI1iTv_HoXCQqAs0DLDG-DBctiqwwVhWDDGLD4zjoRwVYG0dmnWH4_FQBfKIDF3pJR2nTbI1bL6vQw24SBsKdl1RQrLrUIlmv5Y7f01vd00q9dSRc\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u555f\u52d5\u529f\u80fd\u4e26\u958b\u555f\u651d\u5f71\u6a5f<\/h3>\n\n\n\n<p>\u8a2d\u5b9a\u8981\u958b\u555f\u7684\u651d\u5f71\u6a5f\u7de8\u865f\uff0c\u4e26\u6253\u958b\u4eba\u81c9\u6aa2\u6e2c\u529f\u80fd\uff0c\u6700\u91cd\u8981\u7684\u662f\u9019\u88e1\u6703\u6aa2\u67e5\u651d\u5f71\u6a5f\u662f\u5426\u6709\u958b\u555f\u6210\u529f\uff0c\u82e5\u6c92\u6709\u6210\u529f\u6703\u91cd\u8907\u9032\u884c\u8b80\u53d6\u78ba\u8a8d\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/auSEX13biTOJaXYrVVXILkHnMUFNZikjMao9RvBph4TsaJtQgXWY5lf8-AYwqBfkf9ldinj4t6EaFpYAM_9qDuZA3Ip3VGf6C7dx2_tF38wmKSu0bAYMQsEPQUMSWxCiabUqW6M1\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u8f49\u63db\u8272\u5f69\u4e26\u958b\u59cb\u6aa2\u6e2c<\/h3>\n\n\n\n<p>\u9019\u88e1\u6703\u5c07\u8b80\u53d6\u5230\u7684\u5f71\u50cf\u5f9eBGR\u8f49\u63db\u70baRGB\u7684\u8272\u5f69(\u914d\u5408\u4eba\u81c9\u6aa2\u6e2c\u7684\u7167\u7247\u9700\u70baRGB)\uff0c\u518d\u4e1f\u5230\u300c<strong>\u4eba\u81c9\u6aa2\u6e2c\u65b9\u6cd5<\/strong>\u300d\uff0c\u958b\u59cb\u5c0d\u5716\u7247\u9032\u884c\u4eba\u81c9\u6aa2\u6e2c\uff0c\u4e26\u5c07\u6aa2\u6e2c\u7d50\u679c\u5132\u5b58\u4e0b\u4f86\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/mpeaPShZnIRA5ixWj83vvp5FZ2YH_0oa8ucVXoVORxbPUzf55e7cvnujNM8nt983fYlGMUeXUPCgRo2o5hecBMUqE6qaI_GOqMXG0TvpOqia4fmSoWZNmPrhAGRS32HCuTypa2un\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u9084\u539f\u8272\u5f69\u4e26\u6a19\u8a3b<\/h3>\n\n\n\n<p>\u5f97\u5230\u6aa2\u6e2c\u7d50\u679c\u5f8c\uff0c\u5c07\u5f71\u50cf\u8272\u5f69\u8f49\u63db\u56deBGR\u3002\u518d\u900f\u904e\u300c<strong>\u7e6a\u5716\/\u6a19\u8a3b\u65b9\u6cd5<\/strong>\u300d\u5c07\u6aa2\u6e2c\u7d50\u679c\u6a19\u5230\u5f71\u50cf\u4e0a\u5f8c\u986f\u793a\u51fa\u4f86\uff0c\u7a0b\u5f0f\u6703\u4e00\u76f4\u300c<strong>\u4e0d\u505c\u91cd\u8907<\/strong>\u300d\u6aa2\u6e2c\u8207\u986f\u793a\u7684\u52d5\u4f5c\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/fl51lZpHrQEhiHxwYaMLj1OOrxijK4FlJUyUtCeXb2QsVC8B-RCepiI_h-w_vR4Advu9hDHdpZOurlklj0JPF0TQI_z-IU-wbu3Y489wK9mi_4SAXzJE8vyQEOHOyJGx9jLWhrtL\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">5. \u505c\u6b62\u7684\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u8a2d\u5b9a\u7576\u6309\u4e0b\u9375\u76e4\u7684\u300c<strong>Esc<\/strong>\u300d\u6309\u9375\u5c31\u8df3\u51fa\u9019\u500b\u300c<strong>\u91cd\u8907\u7684\u5faa\u74b0<\/strong>\u300d\uff0c\u6700\u5f8c\u91cb\u653e\u651d\u5f71\u6a5f\u4f7f\u756b\u9762\u95dc\u9589\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/Mdn65Jv1buaq01XRQSxFSrNHT42GySfGGIKzpXLCNnUOF1jICLI5s7lMoS9PIaHUUiK3inBJn1nMp-gePcgYIgDQDpmSIKKS7nLyrLp9uGlKbIc-7yBDdJB5xgAuWSq7NxXkaWUw\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">6. \u5c0f\u7d50<\/h3>\n\n\n\n<p>\u7c21\u55ae\u4f86\u8aaa\u5c31\u662f\u5c07\u5fc5\u8981\u7684\u529f\u80fd\u8207\u6703\u7528\u5230\u7684\u529f\u80fd\u5148\u8f09\u5165\uff0c\u63a5\u8457\u91cd\u8907\u53d6\u5f97\u5f71\u50cf\uff1e\u6aa2\u6e2c\uff1e\u6a19\u8a3b\u6aa2\u6e2c\u7d50\u679c\uff1e\u986f\u793a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u516b\u3001\u9032\u968e\u61c9\u7528<\/h2>\n\n\n\n<p>\u6211\u5011\u5df2\u7d93\u9ad4\u9a57\u4e86<a rel=\"noreferrer noopener\" href=\"https:\/\/google.github.io\/mediapipe\/\" target=\"_blank\">MediaPipe<\/a> \u4eba\u81c9\u6aa2\u6e2c\u7684\u5f37\u5927\u529f\u80fd\uff0c\u4e0d\u4f46\u901f\u5ea6\u5feb\uff0c\u800c\u4e14\u4e5f\u633a\u7cbe\u6e96\u7684\u3002\u63a5\u8457\u5c31\u8b93\u6211\u5011\u4f86\u505a\u4e00\u4e9b\u884d\u4f38\u7684\u61c9\u7528\u5427\uff01\u9084\u8a18\u5f97\u5b83\u4e0d\u53ea\u53ef\u4ee5\u6a19\u8a18\u4e00\u500b\u4eba\u7684\u81c9\u55ce\uff1f\u6211\u5011\u53ef\u4ee5\u5584\u7528\u5b83\u53ef\u4ee5\u6a19\u8a3b\u591a\u500b\u4eba\u81c9\u7684\u529f\u80fd\uff0c\u4f86\u88fd\u4f5c\u4e00\u500b\u9632\u75ab\u5c0f\u5c08\u6848\u300c<strong>\u4e0d\u51c6\u7fa4\u805a\u5c0f\u7ba1\u5bb6<\/strong>\u300d\u3002<\/p>\n\n\n\n<p>\u7576\u4eba\u81c9\u6aa2\u6e2c\u5230\u7684\u6578\u91cf\u4e0d\u8d85\u904e5\u500b\u4eba\u6642\uff0c\u6a19\u8a3b\u7684\u6846\u7dda\u984f\u8272\u90fd\u662f<strong><span style=\"color:#00d084\" class=\"tadv-color\">\u7da0\u8272<\/span><\/strong>\u7684\uff0c\u4e00\u65e6\u5075\u6e2c\u5230\u8d85\u904e5\u500b\u4eba\uff0c\u6a19\u8a3b\u7684\u6846\u7dda\u5c31\u6703\u8b8a\u7c97\uff0c\u4e26\u4e14\u984f\u8272\u5f9e<span style=\"color:#00d084\" class=\"tadv-color\"><strong>\u7da0\u8272<\/strong><\/span>\u8f49\u8b8a\u70ba<span style=\"color:#cf2e2e\" class=\"tadv-color\"><strong>\u7d05\u8272<\/strong><\/span>\u3002<\/p>\n\n\n\n<p>\u63a5\u4e0b\u4f86\uff0c\u5148\u4e0b\u8f09\u7a0b\u5f0f\u78bc\uff01\uff01\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e5d\u3001\u9032\u968e\u7a0b\u5f0f\u78bc\u4e0b\u8f09<\/h2>\n\n\n\n<p>1. \u9996\u5148\u900f\u904e\u4e0b\u5217\u9023\u7d50\uff0c\u9032\u5230\u7a0b\u5f0f\u78bc\u6240\u5728\u7684\u9801\u9762\u3002<\/p>\n\n\n\n<p><strong><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/github.com\/iCShopMgr\/MediaPipe_Example\/blob\/main\/face_limit5.py\" target=\"_blank\">\u7a0b\u5f0f\u78bc\u9023\u7d50<\/a><\/strong><\/p>\n\n\n\n<p>2. \u63a5\u8457\u4e00\u6a23\u8907\u88fd\u7db2\u9801\u4e0a\u7684\u7a0b\u5f0f\u78bc\u81f3\u81ea\u5df1\u7684\u7a0b\u5f0f\u7de8\u8f2f\u5668\u3002<\/p>\n\n\n\n<p>3. \u900f\u904e\u7a0b\u5f0f\u7de8\u8f2f\u5668\u5132\u5b58\u6210\u53e6\u4e00\u500b\u6a94\u540d\uff0c\u5f8c\u65b9\u4e00\u6a23\u52a0\u4e0a\u300c<strong>.py<\/strong>\u300d\uff0c\u5c0f\u7de8\u5728\u6b64\u5c07\u9032\u968e\u7684\u7a0b\u5f0f\u78bc\u5132\u5b58\u70ba\u6a94\u540d\u300c<strong>face_limit5.py<\/strong>\u300d\uff0c\u4e4b\u5f8c\u6703\u4ee5\u9019\u500b\u6a94\u540d\u793a\u7bc4\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u3001\u57f7\u884c\u7a0b\u5f0f<\/h2>\n\n\n\n<p>1. \u63a5\u8457\u8b93\u6211\u5011\u4e00\u6a23\u7528\u525b\u525b\u5b78\u7684\u6307\u4ee4\uff0c\u79fb\u52d5\u5230\u60a8\u5b58\u653ePython\u7a0b\u5f0f\u6a94\u6848\u300c<strong>\u6240\u5728\u7684\u4f4d\u7f6e<\/strong>\u300d\u3002<\/p>\n\n\n\n<p>2. \u900f\u904e\u57f7\u884cPython\u6a94\u6848\u7684\u6307\u4ee4\uff0c\u4f86\u958b\u555f\u6a94\u6848\u57f7\u884c\u6211\u5011\u7684\u7a0b\u5f0f\u78bc\u3002\u9996\u5148\u4e00\u6a23\u662f\u8f38\u5165\u300c<strong>python<\/strong>\u300d\uff0c\u900f\u904e\u9019\u500b\u6307\u4ee4\u4f86\u547c\u53eb\u6211\u5011\u8981\u57f7\u884c\u7684Python\u7a0b\u5f0f\u6a94\u6848\uff0c\u63a5\u8457\u7a7a\u4e00\u683c\u518d\u8f38\u5165\u8981\u57f7\u884c\u7684\u6a94\u6848\u540d\u7a31\u4e26\u5305\u542b\u526f\u6a94\u540d\u300c<strong>.py<\/strong>\u300d\u3002<\/p>\n\n\n\n<p>3. \u56e0\u70ba\u5c0f\u7de8\u8eab\u908a\u6c92\u6709\u8d85\u904e5\u4eba\u7684\u7167\u7247\uff0c\u53ef\u4ee5\u8b93MediaPipe\u6aa2\u6e2c\uff0c\u6240\u4ee5\u53ea\u597d\u81ea\u5df1\u81ea\u62cd\u5f8c\u5408\u6210\u4e00\u5f35\u5716\u518d\u62ff\u7d66MediaPipe\u6aa2\u6e2c\uff0c\u6aa2\u6e2c\u7d50\u679c\u5982\u4e0b\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/aTacWUcHMYzci7Jq7b-EUUbB1P9GlEKB7yMnqJiEvgRGtpd3AWHP4TRRnTUkaDhyt0k957IhysRTAmt4k7e-gEvvjeIPTFI63PGGfEln0CRhgVnQeeBrB_svub05UYwkBK2ufQl6\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e00\u3001\u9032\u968e\u7a0b\u5f0f\u78bc\u7c21\u95b1<\/h2>\n\n\n\n<p>\u60a8\u7684\u9632\u75ab\u5c0f\u5c08\u6848\u300c<strong>\u4e0d\u51c6\u7fa4\u805a\u5c0f\u7ba1\u5bb6<\/strong>\u300d\u7684\u7a0b\u5f0f\u78bc\u6709\u6b63\u5e38\u57f7\u884c\u55ce\uff1f\u5176\u5be6\u5b8c\u6210\u9019\u500b\u5c0f\u5c08\u6848\u4e26\u4e0d\u96e3\uff0c\u7a0b\u5f0f\u78bc\u5927\u81f4\u4e0a\u8207\u539f\u5148\u7684\u76f8\u540c\uff0c\u53ea\u662f\u591a\u4e86\u8b80\u53d6\u4eba\u81c9\u6578\u7684\u7a0b\u5f0f\uff0c\u4ee5\u53ca\u4f9d\u7167\u662f\u5426\u8d85\u904e5\u4eba\u8abf\u6574\u984f\u8272\u800c\u5df2\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u8b80\u53d6\u4eba\u6578<\/h3>\n\n\n\n<p>\u900f\u904e\u300c<strong>len(results.detections)<\/strong>\u300d\u9019\u884c\u7a0b\u5f0f\u53ef\u4ee5\u53d6\u5f97\u6aa2\u6e2c\u7684\u7e3d\u4eba\u6578\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/QOQkQU479Zs6TeYNeJwr7a7Xp1Nljv9urvzZNNviqDWoIczQG5u4ZS3HIJwt1AICitumhyf0qC-CDAf8NrFEK1YDPTBTXVJ_Nnhob1e78E6OFmZi0D2guQGHYZf4I7XOdClF8std\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u4f9d\u7167\u689d\u4ef6\u9078\u64c7\u6a19\u8a3b\u7684\u984f\u8272<\/h3>\n\n\n\n<p>\u4f9d\u7167\u7e3d\u4eba\u6578\u4f7f\u7528\u300c<strong>if&#8230;else&#8230;<\/strong>\u300d\u5224\u65b7\u53e5\u8abf\u6574\u300c<strong>draw_detection<\/strong>\u300d\u88e1\u9762\u7684\u5167\u5bb9\u5c31\u5b8c\u6210\u56c9\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/Q4QdaYCOPQ6d51CoR3bNOzzwRMmw7jeEwyoslZNnZtPwuBVROfApSVDr5Z7gOTg_riGei448GBryjlh1W8lrzs2SqxIEuSQOfMFOk2E8QrxArBmo3hvJCktNRIqqfFvdjdxRvRca\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e8c\u3001\u7d50\u8a9e<\/h2>\n\n\n\n<p>\u9019\u4e00\u500b\u55ae\u5143\u5f9e\u57fa\u672c\u7684\u7d42\u7aef\u6a5f\u64cd\u4f5c\u3001\u5982\u4f55\u57f7\u884cPython\u7a0b\u5f0f\uff0c\u5230\u4eba\u81c9\u6aa2\u6e2c\u4e26\u5229\u7528\u529f\u80fd\u7279\u6027\u88fd\u4f5c\u5c0f\u5c08\u6848\u3002\u82e5\u6709\u8208\u8da3\u7684\u8a71\uff0c\u60a8\u4e5f\u53ef\u4ee5\u5617\u8a66\u7528\u9019\u500b\u55ae\u5143\u6559\u7684\u529f\u80fd\uff0c\u88fd\u4f5c\u5c6c\u65bc\u81ea\u5df1\u7684\u5c08\u6848\u3002<\/p>\n\n\n\n<p>\u5176\u5be6\u9664\u4e86\u53ef\u4ee5\u77e5\u9053\u5075\u6e2c\u7684\u4eba\u6578\u8207\u66f4\u6539\u984f\u8272\u4e4b\u5916\uff0c\u6211\u5011\u4e5f\u80fd\u53d6\u5f97\uff0c\u90a36\u500b\u4eba\u81c9\u6a19\u8a3b\u9ede\u5404\u81ea\u7684\u5ea7\u6a19\uff0c\u82e5\u60a8\u5df2\u7d93\u4f7f\u7528Python\u9019\u500b\u8a9e\u8a00\u6709\u4e00\u6bb5\u6642\u9593\uff0c\u53ef\u4ee5\u5617\u8a66\u900f\u904e\u9019\u500b<a href=\"https:\/\/github.com\/google\/mediapipe\/blob\/master\/mediapipe\/python\/solutions\/face_detection.py\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">\u9023\u7d50<\/a>\uff0c\u67e5\u770b\u4eba\u81c9\u6aa2\u6e2c\u7a0b\u5f0f\u5eab\u5167\u7684\u7a0b\u5f0f\u78bc\uff0c\u627e\u5230\u8b80\u53d6\u6a19\u8a3b\u9ede\u7684\u65b9\u6cd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u4e00\u500b\u55ae\u5143\u6559\u5927\u5bb6\u5982\u4f55\u5b89\u88dd MediaPipe\uff0c\u76f8\u4fe1\u60a8\u5df2\u7d93\u77e5\u9053\u5982\u4f55\u5728\u865b\u64ec\u74b0\u5883\u4e2d\u4e0b\u6307\u4ee4\uff0c\u4e26\u4e14\u4e5f\u6e96\u5099\u597d\u7a0b\u5f0f\u7de8\u8f2f\u5668\u4e86\u5427\uff1f\u63a5\u4e0b\u4f86\u8981\u5e36\u5927\u5bb6\u4e00\u8d77\u770b\u770b MediaPipe\u5b98\u65b9\u7db2\u7ad9\u91dd\u5c0d\u6bcf\u500b\u529f\u80fd\uff0c\u6240\u63d0\u4f9b\u7684\u7bc4\u4f8b\u7a0b\u5f0f\uff0c\u672c\u6587\u7684\u4e3b\u984c\u5c31\u662f-\u4eba\u81c9\u6aa2\u6e2c Face Detection\u3002<\/p>\n","protected":false},"author":1,"featured_media":11879,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[191,238],"tags":[42,212,210,135],"table_tags":[],"_links":{"self":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/11463"}],"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=11463"}],"version-history":[{"count":20,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/11463\/revisions"}],"predecessor-version":[{"id":11880,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/11463\/revisions\/11880"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/media\/11879"}],"wp:attachment":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/media?parent=11463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/categories?post=11463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/tags?post=11463"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/table_tags?post=11463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}