{"id":86987,"date":"2026-07-29T15:40:47","date_gmt":"2026-07-29T07:40:47","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/86987.html"},"modified":"2026-07-29T15:40:47","modified_gmt":"2026-07-29T07:40:47","slug":"%e5%ae%9e%e6%97%b6%e6%89%8b%e6%9c%ba%e6%a3%80%e6%b5%8b-%e9%80%9a%e7%94%a8%e9%95%9c%e5%83%8f%e9%83%a8%e7%bd%b2%ef%bc%9a125mb%e8%bd%bb%e9%87%8f%e6%a8%a1%e5%9e%8b%e9%80%82%e9%85%8d%e4%bd%8e%e9%85%8d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/86987.html","title":{"rendered":"\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72\uff1a125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5"},"content":{"rendered":"<h2>\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72&#xff1a;125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5<\/h2>\n<h3>1. \u5f15\u8a00<\/h3>\n<p>\u4f60\u6709\u6ca1\u6709\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1f;\u60f3\u5728\u4f1a\u8bae\u5ba4\u3001\u56fe\u4e66\u9986\u6216\u8005\u751f\u4ea7\u7ebf\u4e0a\u90e8\u7f72\u4e00\u4e2a\u624b\u673a\u68c0\u6d4b\u7cfb\u7edf&#xff0c;\u7528\u6765\u7edf\u8ba1\u624b\u673a\u4f7f\u7528\u60c5\u51b5\u6216\u8005\u786e\u4fdd\u7279\u5b9a\u533a\u57df\u7684\u5b89\u5168&#xff0c;\u7ed3\u679c\u53d1\u73b0\u670d\u52a1\u5668\u914d\u7f6e\u592a\u4f4e&#xff0c;\u8dd1\u4e0d\u52a8\u90a3\u4e9b\u52a8\u8f84\u51e0\u4e2aG\u7684\u68c0\u6d4b\u6a21\u578b\u3002<\/p>\n<p>\u6211\u4e4b\u524d\u5c31\u78b0\u5230\u8fc7\u8fd9\u4e2a\u95ee\u9898\u3002\u5ba2\u6237\u6709\u4e00\u53f0\u8001\u65e7\u7684\u670d\u52a1\u5668&#xff0c;\u5185\u5b58\u53ea\u67094GB&#xff0c;CPU\u4e5f\u662f\u597d\u51e0\u5e74\u524d\u7684\u578b\u53f7&#xff0c;\u4f46\u9700\u8981\u5728\u5165\u53e3\u5904\u5b9e\u65f6\u68c0\u6d4b\u662f\u5426\u6709\u4eba\u643a\u5e26\u624b\u673a\u8fdb\u5165\u3002\u5e02\u9762\u4e0a\u7684\u4e3b\u6d41\u68c0\u6d4b\u6a21\u578b\u8981\u4e48\u592a\u5927\u8dd1\u4e0d\u8d77\u6765&#xff0c;\u8981\u4e48\u901f\u5ea6\u592a\u6162\u8fbe\u4e0d\u5230\u5b9e\u65f6\u8981\u6c42\u3002<\/p>\n<p>\u76f4\u5230\u6211\u53d1\u73b0\u4e86\u963f\u91cc\u5df4\u5df4\u5f00\u6e90\u7684DAMO-YOLO\u624b\u673a\u68c0\u6d4b\u6a21\u578b\u3002\u8fd9\u4e2a\u6a21\u578b\u53ea\u6709125MB\u5927\u5c0f&#xff0c;\u5728\u6807\u51c6\u6d4b\u8bd5\u96c6\u4e0a\u80fd\u8fbe\u523088.8%\u7684\u51c6\u786e\u7387&#xff0c;\u5355\u5f20\u56fe\u7247\u63a8\u7406\u65f6\u95f4\u53ea\u9700\u89813.83\u6beb\u79d2\u3002\u66f4\u91cd\u8981\u7684\u662f&#xff0c;\u5b83\u4e13\u95e8\u9488\u5bf9\u624b\u673a\u8fd9\u4e00\u5355\u4e00\u7c7b\u522b\u8fdb\u884c\u4e86\u4f18\u5316&#xff0c;\u5728\u4fdd\u6301\u9ad8\u7cbe\u5ea6\u7684\u540c\u65f6\u5927\u5e45\u51cf\u5c0f\u4e86\u6a21\u578b\u4f53\u79ef\u3002<\/p>\n<p>\u4eca\u5929\u6211\u5c31\u6765\u5206\u4eab\u5982\u4f55\u628a\u8fd9\u4e2a\u8f7b\u91cf\u7ea7\u4f46\u9ad8\u6027\u80fd\u7684\u624b\u673a\u68c0\u6d4b\u6a21\u578b\u90e8\u7f72\u5230\u4f4e\u914d\u7f6e\u670d\u52a1\u5668\u4e0a&#xff0c;\u8ba9\u4f60\u5373\u4f7f\u5728\u6ca1\u6709\u9ad8\u7aefGPU\u7684\u673a\u5668\u4e0a\u4e5f\u80fd\u5b9e\u73b0\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b\u3002<\/p>\n<h3>2. \u4e3a\u4ec0\u4e48\u9009\u62e9DAMO-YOLO\u624b\u673a\u68c0\u6d4b\u6a21\u578b<\/h3>\n<h4>2.1 \u6a21\u578b\u8f7b\u91cf\u5316\u7684\u5b9e\u9645\u610f\u4e49<\/h4>\n<p>\u4f60\u53ef\u80fd\u542c\u8bf4\u8fc7YOLO\u7cfb\u5217\u7684\u76ee\u6807\u68c0\u6d4b\u6a21\u578b&#xff0c;\u4eceYOLOv1\u5230\u6700\u65b0\u7684YOLOv11&#xff0c;\u6a21\u578b\u6027\u80fd\u8d8a\u6765\u8d8a\u5f3a&#xff0c;\u4f46\u4f53\u79ef\u4e5f\u8d8a\u6765\u8d8a\u5927\u3002\u5bf9\u4e8e\u5f88\u591a\u5b9e\u9645\u5e94\u7528\u573a\u666f\u6765\u8bf4&#xff0c;\u6211\u4eec\u5e76\u4e0d\u9700\u8981\u68c0\u6d4b\u6210\u767e\u4e0a\u5343\u4e2a\u7c7b\u522b&#xff0c;\u53ef\u80fd\u53ea\u9700\u8981\u68c0\u6d4b\u4e00\u4e24\u4e2a\u7279\u5b9a\u7684\u7269\u4f53\u3002<\/p>\n<p>DAMO-YOLO\u624b\u673a\u68c0\u6d4b\u6a21\u578b\u5c31\u662f\u9488\u5bf9\u8fd9\u79cd\u9700\u6c42\u8bbe\u8ba1\u7684\u3002\u5b83\u53ea\u4e13\u6ce8\u4e8e\u68c0\u6d4b\u624b\u673a\u8fd9\u4e00\u4e2a\u7c7b\u522b&#xff0c;\u6240\u4ee5\u6a21\u578b\u7ed3\u6784\u53ef\u4ee5\u505a\u5f97\u66f4\u52a0\u7cbe\u7b80\u3002125MB\u7684\u4f53\u79ef\u610f\u5473\u7740&#xff1a;<\/p>\n<ul>\n<li>\u53ef\u4ee5\u5728\u5185\u5b58\u6709\u9650\u7684\u8bbe\u5907\u4e0a\u8fd0\u884c<\/li>\n<li>\u52a0\u8f7d\u901f\u5ea6\u66f4\u5feb&#xff0c;\u542f\u52a8\u65f6\u95f4\u66f4\u77ed<\/li>\n<li>\u5bf9CPU\u7684\u8981\u6c42\u66f4\u4f4e&#xff0c;\u8001\u673a\u5668\u4e5f\u80fd\u8dd1<\/li>\n<li>\u8282\u7701\u5b58\u50a8\u7a7a\u95f4&#xff0c;\u65b9\u4fbf\u6279\u91cf\u90e8\u7f72<\/li>\n<\/ul>\n<h4>2.2 \u6027\u80fd\u4e0e\u6548\u7387\u7684\u5e73\u8861<\/h4>\n<p>\u8fd9\u4e2a\u6a21\u578b\u5728COCO\u6570\u636e\u96c6\u4e0a\u7684AP&#064;0.5\u8fbe\u5230\u4e8688.8%\u3002AP&#064;0.5\u662f\u4ec0\u4e48\u610f\u601d\u5462&#xff1f;\u7b80\u5355\u6765\u8bf4&#xff0c;\u5c31\u662f\u5f53\u68c0\u6d4b\u6846\u4e0e\u771f\u5b9e\u6846\u7684\u91cd\u53e0\u9762\u79ef\u8d85\u8fc750%\u65f6&#xff0c;\u6a21\u578b\u670988.8%\u7684\u6982\u7387\u80fd\u6b63\u786e\u8bc6\u522b\u51fa\u624b\u673a\u3002<\/p>\n<p>3.83\u6beb\u79d2\u7684\u63a8\u7406\u901f\u5ea6\u53c8\u662f\u4ec0\u4e48\u6982\u5ff5&#xff1f;\u8fd9\u610f\u5473\u7740\u5728\u4e00\u79d2\u949f\u5185&#xff0c;\u8fd9\u4e2a\u6a21\u578b\u53ef\u4ee5\u5904\u7406\u5927\u7ea6260\u5f20\u56fe\u7247\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u5b9e\u65f6\u76d1\u63a7\u573a\u666f&#xff08;\u901a\u5e38\u6bcf\u79d225-30\u5e27&#xff09;&#xff0c;\u8fd9\u4e2a\u901f\u5ea6\u7ef0\u7ef0\u6709\u4f59\u3002<\/p>\n<p>\u66f4\u91cd\u8981\u7684\u662f&#xff0c;\u8fd9\u4e2a\u901f\u5ea6\u662f\u5728T4\u663e\u5361\u4e0a\u6d4b\u5f97\u7684\u3002\u5728\u5b9e\u9645\u7684\u4f4e\u914d\u670d\u52a1\u5668\u4e0a&#xff0c;\u5373\u4f7f\u53ea\u7528CPU&#xff0c;\u4e5f\u80fd\u8fbe\u5230\u6bcf\u79d2\u51e0\u5341\u5e27\u7684\u5904\u7406\u901f\u5ea6&#xff0c;\u5b8c\u5168\u6ee1\u8db3\u5b9e\u65f6\u68c0\u6d4b\u7684\u9700\u6c42\u3002<\/p>\n<h3>3. \u73af\u5883\u51c6\u5907\u4e0e\u5feb\u901f\u90e8\u7f72<\/h3>\n<h4>3.1 \u670d\u52a1\u5668\u8981\u6c42\u68c0\u67e5<\/h4>\n<p>\u5728\u5f00\u59cb\u90e8\u7f72\u4e4b\u524d&#xff0c;\u6211\u4eec\u5148\u786e\u8ba4\u4e00\u4e0b\u4f60\u7684\u670d\u52a1\u5668\u662f\u5426\u6ee1\u8db3\u57fa\u672c\u8981\u6c42&#xff1a;<\/p>\n<ul>\n<li>\u64cd\u4f5c\u7cfb\u7edf&#xff1a;Linux&#xff08;\u63a8\u8350Ubuntu 18.04\u6216\u66f4\u9ad8\u7248\u672c&#xff09;<\/li>\n<li>\u5185\u5b58&#xff1a;\u81f3\u5c112GB\u53ef\u7528\u5185\u5b58<\/li>\n<li>\u5b58\u50a8\u7a7a\u95f4&#xff1a;\u81f3\u5c11500MB\u53ef\u7528\u7a7a\u95f4<\/li>\n<li>Python\u7248\u672c&#xff1a;Python 3.7\u6216\u66f4\u9ad8\u7248\u672c<\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u7528\u7684\u662fWindows\u670d\u52a1\u5668&#xff0c;\u5efa\u8bae\u5148\u5b89\u88c5WSL2&#xff08;Windows Subsystem for Linux&#xff09;&#xff0c;\u7136\u540e\u5728WSL2\u4e2d\u8fd0\u884c\u3002\u4e0d\u8fc7\u4ece\u6211\u7684\u7ecf\u9a8c\u6765\u770b&#xff0c;Linux\u73af\u5883\u4e0b\u7684\u90e8\u7f72\u4f1a\u66f4\u7b80\u5355\u7a33\u5b9a\u3002<\/p>\n<h4>3.2 \u4e00\u952e\u90e8\u7f72\u6b65\u9aa4<\/h4>\n<p>\u90e8\u7f72\u8fc7\u7a0b\u6bd4\u4f60\u60f3\u7684\u8981\u7b80\u5355\u5f97\u591a\u3002\u6574\u4e2a\u6d41\u7a0b\u53ef\u4ee5\u5206\u4e3a\u4e09\u4e2a\u4e3b\u8981\u6b65\u9aa4&#xff1a;<\/p>\n<li>\u4e0b\u8f7d\u6a21\u578b\u548c\u4ee3\u7801<\/li>\n<li>\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305<\/li>\n<li>\u542f\u52a8\u68c0\u6d4b\u670d\u52a1<\/li>\n<p>\u6211\u4eec\u5148\u4ece\u6700\u57fa\u7840\u7684\u5f00\u59cb\u3002\u6253\u5f00\u4f60\u7684\u670d\u52a1\u5668\u7ec8\u7aef&#xff0c;\u4f9d\u6b21\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4&#xff1a;<\/p>\n<p># \u7b2c\u4e00\u6b65&#xff1a;\u8fdb\u5165\u9879\u76ee\u76ee\u5f55&#xff08;\u5982\u679c\u76ee\u5f55\u4e0d\u5b58\u5728\u4f1a\u81ea\u52a8\u521b\u5efa&#xff09;<br \/>\ncd \/root<\/p>\n<p># \u7b2c\u4e8c\u6b65&#xff1a;\u514b\u9686\u9879\u76ee\u4ee3\u7801<br \/>\ngit clone https:\/\/github.com\/modelscope\/modelscope.git<br \/>\ncd modelscope<\/p>\n<p># \u7b2c\u4e09\u6b65&#xff1a;\u5b89\u88c5ModelScope\u6846\u67b6<br \/>\npip install modelscope -i https:\/\/mirrors.aliyun.com\/pypi\/simple\/<\/p>\n<p># \u7b2c\u56db\u6b65&#xff1a;\u8fdb\u5165\u624b\u673a\u68c0\u6d4b\u9879\u76ee\u76ee\u5f55<br \/>\ncd \/root\/cv_tinynas_object-detection_damoyolo_phone<\/p>\n<p>\u5982\u679c\u4e00\u5207\u987a\u5229&#xff0c;\u4f60\u5e94\u8be5\u80fd\u770b\u5230\u9879\u76ee\u76ee\u5f55\u4e0b\u6709\u51e0\u4e2a\u5173\u952e\u6587\u4ef6&#xff1a;<\/p>\n<ul>\n<li>app.py &#8211; Web\u670d\u52a1\u7684\u4e3b\u7a0b\u5e8f<\/li>\n<li>start.sh &#8211; \u542f\u52a8\u811a\u672c<\/li>\n<li>requirements.txt &#8211; \u4f9d\u8d56\u5305\u5217\u8868<\/li>\n<\/ul>\n<h4>3.3 \u4f9d\u8d56\u5b89\u88c5\u4e0e\u914d\u7f6e<\/h4>\n<p>\u63a5\u4e0b\u6765\u5b89\u88c5\u8fd0\u884c\u6240\u9700\u7684\u6240\u6709\u8f6f\u4ef6\u5305&#xff1a;<\/p>\n<p># \u5b89\u88c5\u9879\u76ee\u4f9d\u8d56<br \/>\npip install -r requirements.txt -i https:\/\/mirrors.aliyun.com\/pypi\/simple\/<\/p>\n<p>\u8fd9\u91cc\u6709\u51e0\u4e2a\u5173\u952e\u4f9d\u8d56\u9700\u8981\u7279\u522b\u8bf4\u660e&#xff1a;<\/p>\n<ul>\n<li>ModelScope&#xff1a;\u963f\u91cc\u5df4\u5df4\u5f00\u6e90\u7684\u6a21\u578b\u7ba1\u7406\u6846\u67b6&#xff0c;\u7248\u672c\u9700\u89811.34.0\u6216\u66f4\u9ad8<\/li>\n<li>PyTorch&#xff1a;\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6&#xff0c;2.0.0\u7248\u672c\u4ee5\u4e0a\u90fd\u53ef\u4ee5<\/li>\n<li>Gradio&#xff1a;\u7528\u4e8e\u6784\u5efaWeb\u754c\u9762\u7684\u5de5\u5177&#xff0c;\u8ba9\u68c0\u6d4b\u670d\u52a1\u6709\u4e2a\u597d\u770b\u7684\u7f51\u9875\u754c\u9762<\/li>\n<li>OpenCV&#xff1a;\u56fe\u50cf\u5904\u7406\u5e93&#xff0c;\u7528\u4e8e\u8bfb\u53d6\u548c\u663e\u793a\u56fe\u7247<\/li>\n<\/ul>\n<p>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u5982\u679c\u9047\u5230\u7f51\u7edc\u95ee\u9898&#xff0c;\u53ef\u4ee5\u5c1d\u8bd5\u66f4\u6362pip\u6e90\u3002\u4e0a\u9762\u547d\u4ee4\u4e2d\u4f7f\u7528\u7684-i https:\/\/mirrors.aliyun.com\/pypi\/simple\/\u5c31\u662f\u963f\u91cc\u4e91\u7684\u955c\u50cf\u6e90&#xff0c;\u4e0b\u8f7d\u901f\u5ea6\u4f1a\u5feb\u5f88\u591a\u3002<\/p>\n<h3>4. \u542f\u52a8\u4e0e\u4f7f\u7528\u624b\u673a\u68c0\u6d4b\u670d\u52a1<\/h3>\n<h4>4.1 \u901a\u8fc7Web\u754c\u9762\u4f7f\u7528<\/h4>\n<p>\u8fd9\u662f\u6700\u7b80\u5355\u76f4\u89c2\u7684\u4f7f\u7528\u65b9\u5f0f\u3002\u542f\u52a8\u670d\u52a1\u540e&#xff0c;\u4f60\u4f1a\u5f97\u5230\u4e00\u4e2a\u7f51\u9875\u5730\u5740&#xff0c;\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u5c31\u80fd\u76f4\u63a5\u4f7f\u7528\u3002<\/p>\n<p>\u542f\u52a8\u670d\u52a1\u7684\u547d\u4ee4\u5f88\u7b80\u5355&#xff1a;<\/p>\n<p># \u65b9\u6cd5\u4e00&#xff1a;\u4f7f\u7528\u542f\u52a8\u811a\u672c&#xff08;\u63a8\u8350&#xff09;<br \/>\n.\/start.sh<\/p>\n<p># \u65b9\u6cd5\u4e8c&#xff1a;\u76f4\u63a5\u8fd0\u884cPython\u7a0b\u5e8f<br \/>\npython3 app.py<\/p>\n<p>\u6267\u884c\u540e&#xff0c;\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u8fd9\u6837\u7684\u8f93\u51fa&#xff1a;<\/p>\n<p>Running on local URL:  http:\/\/0.0.0.0:7860<br \/>\nRunning on public URL: https:\/\/xxxx.gradio.live<\/p>\n<p>\u73b0\u5728\u6253\u5f00\u6d4f\u89c8\u5668&#xff0c;\u8bbf\u95eehttp:\/\/\u4f60\u7684\u670d\u52a1\u5668IP:7860&#xff08;\u5982\u679c\u662f\u672c\u5730\u670d\u52a1\u5668&#xff0c;\u5c31\u662fhttp:\/\/localhost:7860&#xff09;\u3002<\/p>\n<p>\u4f60\u4f1a\u770b\u5230\u4e00\u4e2a\u7b80\u6d01\u7684Web\u754c\u9762&#xff0c;\u4e3b\u8981\u5305\u542b\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206&#xff1a;<\/p>\n<li>\u56fe\u7247\u4e0a\u4f20\u533a\u57df&#xff1a;\u53ef\u4ee5\u62d6\u62fd\u56fe\u7247\u6216\u8005\u70b9\u51fb\u9009\u62e9\u6587\u4ef6<\/li>\n<li>\u793a\u4f8b\u56fe\u7247\u6309\u94ae&#xff1a;\u70b9\u51fb\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u5185\u7f6e\u7684\u793a\u4f8b\u56fe\u7247<\/li>\n<li>\u5f00\u59cb\u68c0\u6d4b\u6309\u94ae&#xff1a;\u4e0a\u4f20\u56fe\u7247\u540e\u70b9\u51fb\u8fd9\u91cc\u5f00\u59cb\u68c0\u6d4b<\/li>\n<li>\u7ed3\u679c\u663e\u793a\u533a\u57df&#xff1a;\u68c0\u6d4b\u5b8c\u6210\u540e\u4f1a\u5728\u8fd9\u91cc\u663e\u793a\u7ed3\u679c<\/li>\n<p>\u4f7f\u7528\u6d41\u7a0b\u4e5f\u5f88\u76f4\u89c2&#xff1a;<\/p>\n<ul>\n<li>\u4e0a\u4f20\u4e00\u5f20\u5305\u542b\u624b\u673a\u7684\u56fe\u7247<\/li>\n<li>\u70b9\u51fb&#034;\u5f00\u59cb\u68c0\u6d4b&#034;\u6309\u94ae<\/li>\n<li>\u7b49\u5f85\u51e0\u79d2\u949f&#xff0c;\u67e5\u770b\u68c0\u6d4b\u7ed3\u679c<\/li>\n<\/ul>\n<p>\u68c0\u6d4b\u7ed3\u679c\u4f1a\u7528\u7ea2\u8272\u7684\u65b9\u6846\u6807\u51fa\u56fe\u7247\u4e2d\u6240\u6709\u7684\u624b\u673a&#xff0c;\u6bcf\u4e2a\u65b9\u6846\u65c1\u8fb9\u8fd8\u4f1a\u663e\u793a\u4e00\u4e2a\u7f6e\u4fe1\u5ea6\u5206\u6570&#xff0c;\u8868\u793a\u6a21\u578b\u5bf9\u8fd9\u4e2a\u68c0\u6d4b\u7ed3\u679c\u7684\u628a\u63e1\u7a0b\u5ea6\u3002\u5206\u6570\u8d8a\u9ad8&#xff0c;\u8bf4\u660e\u6a21\u578b\u8d8a\u786e\u5b9a\u8fd9\u91cc\u6709\u4e2a\u624b\u673a\u3002<\/p>\n<h4>4.2 \u901a\u8fc7Python API\u8c03\u7528<\/h4>\n<p>\u5982\u679c\u4f60\u9700\u8981\u5728\u5176\u4ed6\u7a0b\u5e8f\u4e2d\u96c6\u6210\u624b\u673a\u68c0\u6d4b\u529f\u80fd&#xff0c;\u6216\u8005\u60f3\u8981\u6279\u91cf\u5904\u7406\u56fe\u7247&#xff0c;\u4f7f\u7528Python API\u4f1a\u66f4\u52a0\u65b9\u4fbf\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u793a\u4f8b\u4ee3\u7801&#xff1a;<\/p>\n<p># \u5bfc\u5165\u5fc5\u8981\u7684\u5e93<br \/>\nfrom modelscope.pipelines import pipeline<br \/>\nfrom modelscope.utils.constant import Tasks<br \/>\nimport cv2<br \/>\nimport matplotlib.pyplot as plt<\/p>\n<p>def detect_phones_in_image(image_path):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u68c0\u6d4b\u56fe\u7247\u4e2d\u7684\u624b\u673a<\/p>\n<p>    \u53c2\u6570:<br \/>\n        image_path: \u56fe\u7247\u6587\u4ef6\u8def\u5f84<\/p>\n<p>    \u8fd4\u56de:<br \/>\n        \u68c0\u6d4b\u7ed3\u679c&#xff0c;\u5305\u542b\u8fb9\u754c\u6846\u548c\u7f6e\u4fe1\u5ea6<br \/>\n    &#034;&#034;&#034;<br \/>\n    # \u7b2c\u4e00\u6b65&#xff1a;\u521b\u5efa\u68c0\u6d4b\u5668<br \/>\n    # \u8fd9\u91cc\u6307\u5b9a\u4efb\u52a1\u7c7b\u578b\u4e3a\u7279\u5b9a\u9886\u57df\u76ee\u6807\u68c0\u6d4b<br \/>\n    detector &#061; pipeline(<br \/>\n        Tasks.domain_specific_object_detection,<br \/>\n        model&#061;&#039;damo\/cv_tinynas_object-detection_damoyolo_phone&#039;,<br \/>\n        cache_dir&#061;&#039;\/root\/ai-models&#039;,  # \u6a21\u578b\u7f13\u5b58\u76ee\u5f55<br \/>\n        trust_remote_code&#061;True  # \u4fe1\u4efb\u8fdc\u7a0b\u4ee3\u7801&#xff08;\u5fc5\u987b\u8bbe\u7f6e&#xff09;<br \/>\n    )<\/p>\n<p>    # \u7b2c\u4e8c\u6b65&#xff1a;\u6267\u884c\u68c0\u6d4b<br \/>\n    result &#061; detector(image_path)<\/p>\n<p>    # \u7b2c\u4e09\u6b65&#xff1a;\u5904\u7406\u7ed3\u679c<br \/>\n    print(&#034;\u68c0\u6d4b\u5b8c\u6210&#xff01;&#034;)<br \/>\n    print(f&#034;\u5171\u68c0\u6d4b\u5230 {len(result[&#039;boxes&#039;])} \u4e2a\u624b\u673a&#034;)<\/p>\n<p>    # \u663e\u793a\u6bcf\u4e2a\u68c0\u6d4b\u7ed3\u679c\u7684\u8be6\u7ec6\u4fe1\u606f<br \/>\n    for i, (box, score) in enumerate(zip(result[&#039;boxes&#039;], result[&#039;scores&#039;])):<br \/>\n        print(f&#034;\u624b\u673a {i&#043;1}:&#034;)<br \/>\n        print(f&#034;  \u4f4d\u7f6e: \u5de6\u4e0a({box[0]:.1f}, {box[1]:.1f}), &#034;<br \/>\n              f&#034;\u53f3\u4e0b({box[2]:.1f}, {box[3]:.1f})&#034;)<br \/>\n        print(f&#034;  \u7f6e\u4fe1\u5ea6: {score:.3f}&#034;)<\/p>\n<p>    return result<\/p>\n<p># \u4f7f\u7528\u793a\u4f8b<br \/>\nif __name__ &#061;&#061; &#034;__main__&#034;:<br \/>\n    # \u68c0\u6d4b\u5355\u5f20\u56fe\u7247<br \/>\n    result &#061; detect_phones_in_image(&#034;test_image.jpg&#034;)<\/p>\n<p>    # \u5982\u679c\u4f60\u60f3\u8981\u53ef\u89c6\u5316\u7ed3\u679c<br \/>\n    image &#061; cv2.imread(&#034;test_image.jpg&#034;)<br \/>\n    image &#061; cv2.cvtColor(image, cv2.COLOR_BGR2RGB)<\/p>\n<p>    # \u5728\u56fe\u7247\u4e0a\u7ed8\u5236\u68c0\u6d4b\u6846<br \/>\n    for box, score in zip(result[&#039;boxes&#039;], result[&#039;scores&#039;]):<br \/>\n        x1, y1, x2, y2 &#061; map(int, box)<br \/>\n        # \u7ed8\u5236\u77e9\u5f62\u6846<br \/>\n        cv2.rectangle(image, (x1, y1), (x2, y2), (255, 0, 0), 2)<br \/>\n        # \u6dfb\u52a0\u7f6e\u4fe1\u5ea6\u6587\u672c<br \/>\n        cv2.putText(image, f&#034;phone: {score:.2f}&#034;,<br \/>\n                   (x1, y1-10), cv2.FONT_HERSHEY_SIMPLEX,<br \/>\n                   0.5, (255, 0, 0), 2)<\/p>\n<p>    # \u4fdd\u5b58\u7ed3\u679c\u56fe\u7247<br \/>\n    cv2.imwrite(&#034;result.jpg&#034;, cv2.cvtColor(image, cv2.COLOR_RGB2BGR))<br \/>\n    print(&#034;\u7ed3\u679c\u5df2\u4fdd\u5b58\u5230 result.jpg&#034;)<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u505a\u4e86\u51e0\u4ef6\u4e8b\u60c5&#xff1a;<\/p>\n<li>\u521b\u5efa\u4e86\u4e00\u4e2a\u624b\u673a\u68c0\u6d4b\u5668<\/li>\n<li>\u5bf9\u6307\u5b9a\u56fe\u7247\u8fdb\u884c\u68c0\u6d4b<\/li>\n<li>\u6253\u5370\u51fa\u68c0\u6d4b\u5230\u7684\u624b\u673a\u6570\u91cf\u548c\u4f4d\u7f6e<\/li>\n<li>\u5728\u56fe\u7247\u4e0a\u753b\u51fa\u68c0\u6d4b\u6846\u5e76\u4fdd\u5b58<\/li>\n<h4>4.3 \u6279\u91cf\u5904\u7406\u56fe\u7247<\/h4>\n<p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d&#xff0c;\u6211\u4eec\u7ecf\u5e38\u9700\u8981\u5904\u7406\u5927\u91cf\u56fe\u7247\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u6279\u91cf\u5904\u7406\u7684\u793a\u4f8b&#xff1a;<\/p>\n<p>import os<br \/>\nfrom modelscope.pipelines import pipeline<br \/>\nfrom modelscope.utils.constant import Tasks<\/p>\n<p>def batch_detect_phones(image_folder, output_folder):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u6279\u91cf\u68c0\u6d4b\u6587\u4ef6\u5939\u4e2d\u7684\u6240\u6709\u56fe\u7247<\/p>\n<p>    \u53c2\u6570:<br \/>\n        image_folder: \u8f93\u5165\u56fe\u7247\u6587\u4ef6\u5939\u8def\u5f84<br \/>\n        output_folder: \u8f93\u51fa\u7ed3\u679c\u6587\u4ef6\u5939\u8def\u5f84<br \/>\n    &#034;&#034;&#034;<br \/>\n    # \u521b\u5efa\u8f93\u51fa\u6587\u4ef6\u5939<br \/>\n    os.makedirs(output_folder, exist_ok&#061;True)<\/p>\n<p>    # \u521d\u59cb\u5316\u68c0\u6d4b\u5668&#xff08;\u53ea\u521d\u59cb\u5316\u4e00\u6b21&#xff0c;\u63d0\u9ad8\u6548\u7387&#xff09;<br \/>\n    detector &#061; pipeline(<br \/>\n        Tasks.domain_specific_object_detection,<br \/>\n        model&#061;&#039;damo\/cv_tinynas_object-detection_damoyolo_phone&#039;,<br \/>\n        cache_dir&#061;&#039;\/root\/ai-models&#039;,<br \/>\n        trust_remote_code&#061;True<br \/>\n    )<\/p>\n<p>    # \u83b7\u53d6\u6240\u6709\u56fe\u7247\u6587\u4ef6<br \/>\n    image_extensions &#061; [&#039;.jpg&#039;, &#039;.jpeg&#039;, &#039;.png&#039;, &#039;.bmp&#039;]<br \/>\n    image_files &#061; []<\/p>\n<p>    for file in os.listdir(image_folder):<br \/>\n        if any(file.lower().endswith(ext) for ext in image_extensions):<br \/>\n            image_files.append(os.path.join(image_folder, file))<\/p>\n<p>    print(f&#034;\u627e\u5230 {len(image_files)} \u5f20\u56fe\u7247\u9700\u8981\u5904\u7406&#034;)<\/p>\n<p>    # \u6279\u91cf\u5904\u7406<br \/>\n    for i, image_path in enumerate(image_files):<br \/>\n        print(f&#034;\u5904\u7406\u7b2c {i&#043;1}\/{len(image_files)} \u5f20: {os.path.basename(image_path)}&#034;)<\/p>\n<p>        try:<br \/>\n            # \u6267\u884c\u68c0\u6d4b<br \/>\n            result &#061; detector(image_path)<\/p>\n<p>            # \u4fdd\u5b58\u68c0\u6d4b\u7ed3\u679c\u5230\u6587\u672c\u6587\u4ef6<br \/>\n            output_file &#061; os.path.join(<br \/>\n                output_folder,<br \/>\n                os.path.splitext(os.path.basename(image_path))[0] &#043; &#034;.txt&#034;<br \/>\n            )<\/p>\n<p>            with open(output_file, &#039;w&#039;) as f:<br \/>\n                f.write(f&#034;\u56fe\u7247: {os.path.basename(image_path)}\\\\n&#034;)<br \/>\n                f.write(f&#034;\u68c0\u6d4b\u5230\u624b\u673a\u6570\u91cf: {len(result[&#039;boxes&#039;])}\\\\n\\\\n&#034;)<\/p>\n<p>                for j, (box, score) in enumerate(zip(result[&#039;boxes&#039;], result[&#039;scores&#039;])):<br \/>\n                    f.write(f&#034;\u624b\u673a {j&#043;1}:\\\\n&#034;)<br \/>\n                    f.write(f&#034;  \u8fb9\u754c\u6846: [{box[0]:.1f}, {box[1]:.1f}, {box[2]:.1f}, {box[3]:.1f}]\\\\n&#034;)<br \/>\n                    f.write(f&#034;  \u7f6e\u4fe1\u5ea6: {score:.4f}\\\\n&#034;)<br \/>\n                    f.write(&#034;-&#034; * 40 &#043; &#034;\\\\n&#034;)<\/p>\n<p>            print(f&#034;  \u7ed3\u679c\u5df2\u4fdd\u5b58\u5230: {output_file}&#034;)<\/p>\n<p>        except Exception as e:<br \/>\n            print(f&#034;  \u5904\u7406\u5931\u8d25: {str(e)}&#034;)<\/p>\n<p>    print(&#034;\u6279\u91cf\u5904\u7406\u5b8c\u6210&#xff01;&#034;)<\/p>\n<p># \u4f7f\u7528\u793a\u4f8b<br \/>\nif __name__ &#061;&#061; &#034;__main__&#034;:<br \/>\n    # \u5904\u7406images\u6587\u4ef6\u5939\u4e2d\u7684\u6240\u6709\u56fe\u7247&#xff0c;\u7ed3\u679c\u4fdd\u5b58\u5230results\u6587\u4ef6\u5939<br \/>\n    batch_detect_phones(&#034;images&#034;, &#034;results&#034;)<\/p>\n<h3>5. \u4f4e\u914d\u670d\u52a1\u5668\u4f18\u5316\u6280\u5de7<\/h3>\n<h4>5.1 \u5185\u5b58\u4f7f\u7528\u4f18\u5316<\/h4>\n<p>\u5728\u5185\u5b58\u6709\u9650\u7684\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b&#xff0c;\u5185\u5b58\u7ba1\u7406\u7279\u522b\u91cd\u8981\u3002\u4e0b\u9762\u662f\u4e00\u4e9b\u5b9e\u7528\u7684\u4f18\u5316\u6280\u5de7&#xff1a;<\/p>\n<p>import gc<br \/>\nimport torch<\/p>\n<p>def memory_efficient_detection(image_path):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u5185\u5b58\u53cb\u597d\u7684\u68c0\u6d4b\u51fd\u6570<\/p>\n<p>    \u8fd9\u4e2a\u51fd\u6570\u4f1a\u5728\u68c0\u6d4b\u5b8c\u6210\u540e\u7acb\u5373\u91ca\u653e\u5185\u5b58&#xff0c;<br \/>\n    \u9002\u5408\u5728\u5185\u5b58\u6709\u9650\u7684\u8bbe\u5907\u4e0a\u957f\u65f6\u95f4\u8fd0\u884c\u3002<br \/>\n    &#034;&#034;&#034;<br \/>\n    # \u53ea\u5728\u9700\u8981\u65f6\u52a0\u8f7d\u6a21\u578b<br \/>\n    from modelscope.pipelines import pipeline<br \/>\n    from modelscope.utils.constant import Tasks<\/p>\n<p>    try:<br \/>\n        # \u521b\u5efa\u68c0\u6d4b\u5668<br \/>\n        detector &#061; pipeline(<br \/>\n            Tasks.domain_specific_object_detection,<br \/>\n            model&#061;&#039;damo\/cv_tinynas_object-detection_damoyolo_phone&#039;,<br \/>\n            cache_dir&#061;&#039;\/root\/ai-models&#039;,<br \/>\n            trust_remote_code&#061;True<br \/>\n        )<\/p>\n<p>        # \u6267\u884c\u68c0\u6d4b<br \/>\n        result &#061; detector(image_path)<\/p>\n<p>        # \u7acb\u5373\u5220\u9664\u68c0\u6d4b\u5668\u91ca\u653e\u5185\u5b58<br \/>\n        del detector<\/p>\n<p>        # \u5f3a\u5236\u5783\u573e\u56de\u6536<br \/>\n        gc.collect()<\/p>\n<p>        # \u5982\u679c\u4f7f\u7528GPU&#xff0c;\u6e05\u7a7a\u7f13\u5b58<br \/>\n        if torch.cuda.is_available():<br \/>\n            torch.cuda.empty_cache()<\/p>\n<p>        return result<\/p>\n<p>    except Exception as e:<br \/>\n        print(f&#034;\u68c0\u6d4b\u5931\u8d25: {str(e)}&#034;)<br \/>\n        return None<\/p>\n<h4>5.2 \u56fe\u7247\u9884\u5904\u7406\u4f18\u5316<\/h4>\n<p>\u5904\u7406\u5927\u5c3a\u5bf8\u56fe\u7247\u4f1a\u6d88\u8017\u66f4\u591a\u5185\u5b58\u3002\u6211\u4eec\u53ef\u4ee5\u5148\u8c03\u6574\u56fe\u7247\u5927\u5c0f&#xff0c;\u518d\u8fdb\u884c\u68c0\u6d4b&#xff1a;<\/p>\n<p>from PIL import Image<br \/>\nimport numpy as np<\/p>\n<p>def resize_and_detect(image_path, max_size&#061;1024):<br \/>\n    &#034;&#034;&#034;<br \/>\n    \u5148\u8c03\u6574\u56fe\u7247\u5927\u5c0f\u518d\u68c0\u6d4b&#xff0c;\u51cf\u5c11\u5185\u5b58\u4f7f\u7528<\/p>\n<p>    \u53c2\u6570:<br \/>\n        image_path: \u56fe\u7247\u8def\u5f84<br \/>\n        max_size: \u56fe\u7247\u6700\u5927\u8fb9\u957f&#xff0c;\u9ed8\u8ba41024\u50cf\u7d20<br \/>\n    &#034;&#034;&#034;<br \/>\n    # \u4f7f\u7528PIL\u6253\u5f00\u56fe\u7247\u5e76\u8c03\u6574\u5927\u5c0f<br \/>\n    img &#061; Image.open(image_path)<\/p>\n<p>    # \u83b7\u53d6\u539f\u59cb\u5c3a\u5bf8<br \/>\n    width, height &#061; img.size<\/p>\n<p>    # \u8ba1\u7b97\u8c03\u6574\u540e\u7684\u5c3a\u5bf8&#xff08;\u4fdd\u6301\u5bbd\u9ad8\u6bd4&#xff09;<br \/>\n    if max(width, height) &gt; max_size:<br \/>\n        if width &gt; height:<br \/>\n            new_width &#061; max_size<br \/>\n            new_height &#061; int(height * (max_size \/ width))<br \/>\n        else:<br \/>\n            new_height &#061; max_size<br \/>\n            new_width &#061; int(width * (max_size \/ height))<\/p>\n<p>        img &#061; img.resize((new_width, new_height), Image.Resampling.LANCZOS)<br \/>\n        print(f&#034;\u56fe\u7247\u4ece {width}x{height} \u8c03\u6574\u5230 {new_width}x{new_height}&#034;)<\/p>\n<p>    # \u4fdd\u5b58\u8c03\u6574\u540e\u7684\u4e34\u65f6\u6587\u4ef6<br \/>\n    temp_path &#061; &#034;temp_resized.jpg&#034;<br \/>\n    img.save(temp_path)<\/p>\n<p>    # \u4f7f\u7528\u8c03\u6574\u540e\u7684\u56fe\u7247\u8fdb\u884c\u68c0\u6d4b<br \/>\n    from modelscope.pipelines import pipeline<br \/>\n    from modelscope.utils.constant import Tasks<\/p>\n<p>    detector &#061; pipeline(<br \/>\n        Tasks.domain_specific_object_detection,<br \/>\n        model&#061;&#039;damo\/cv_tinynas_object-detection_damoyolo_phone&#039;,<br \/>\n        cache_dir&#061;&#039;\/root\/ai-models&#039;,<br \/>\n        trust_remote_code&#061;True<br \/>\n    )<\/p>\n<p>    result &#061; detector(temp_path)<\/p>\n<p>    # \u6e05\u7406\u4e34\u65f6\u6587\u4ef6<br \/>\n    import os<br \/>\n    os.remove(temp_path)<\/p>\n<p>    return result<\/p>\n<h4>5.3 \u670d\u52a1\u7ba1\u7406\u811a\u672c<\/h4>\n<p>\u5bf9\u4e8e\u957f\u671f\u8fd0\u884c\u7684\u670d\u52a1&#xff0c;\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u53ef\u9760\u7684\u7ba1\u7406\u65b9\u5f0f\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u670d\u52a1\u7ba1\u7406\u811a\u672c&#xff1a;<\/p>\n<p>#!\/bin\/bash<br \/>\n# service_manager.sh &#8211; \u624b\u673a\u68c0\u6d4b\u670d\u52a1\u7ba1\u7406\u811a\u672c<\/p>\n<p>SERVICE_DIR&#061;&#034;\/root\/cv_tinynas_object-detection_damoyolo_phone&#034;<br \/>\nLOG_FILE&#061;&#034;$SERVICE_DIR\/service.log&#034;<br \/>\nPID_FILE&#061;&#034;$SERVICE_DIR\/service.pid&#034;<\/p>\n<p>start_service() {<br \/>\n    echo &#034;\u6b63\u5728\u542f\u52a8\u624b\u673a\u68c0\u6d4b\u670d\u52a1&#8230;&#034;<br \/>\n    cd $SERVICE_DIR<br \/>\n    nohup python3 app.py &gt; $LOG_FILE 2&gt;&amp;1 &amp;<br \/>\n    echo $! &gt; $PID_FILE<br \/>\n    echo &#034;\u670d\u52a1\u5df2\u542f\u52a8&#xff0c;PID: $(cat $PID_FILE)&#034;<br \/>\n    echo &#034;\u65e5\u5fd7\u6587\u4ef6: $LOG_FILE&#034;<br \/>\n    echo &#034;Web\u754c\u9762: http:\/\/localhost:7860&#034;<br \/>\n}<\/p>\n<p>stop_service() {<br \/>\n    if [ -f $PID_FILE ]; then<br \/>\n        PID&#061;$(cat $PID_FILE)<br \/>\n        echo &#034;\u6b63\u5728\u505c\u6b62\u670d\u52a1 (PID: $PID)&#8230;&#034;<br \/>\n        kill $PID<br \/>\n        rm $PID_FILE<br \/>\n        echo &#034;\u670d\u52a1\u5df2\u505c\u6b62&#034;<br \/>\n    else<br \/>\n        echo &#034;\u670d\u52a1\u672a\u8fd0\u884c&#034;<br \/>\n    fi<br \/>\n}<\/p>\n<p>restart_service() {<br \/>\n    stop_service<br \/>\n    sleep 2<br \/>\n    start_service<br \/>\n}<\/p>\n<p>check_status() {<br \/>\n    if [ -f $PID_FILE ]; then<br \/>\n        PID&#061;$(cat $PID_FILE)<br \/>\n        if ps -p $PID &gt; \/dev\/null; then<br \/>\n            echo &#034;\u670d\u52a1\u6b63\u5728\u8fd0\u884c (PID: $PID)&#034;<br \/>\n            echo &#034;\u67e5\u770b\u65e5\u5fd7: tail -f $LOG_FILE&#034;<br \/>\n        else<br \/>\n            echo &#034;\u670d\u52a1\u8fdb\u7a0b\u4e0d\u5b58\u5728&#xff0c;\u4f46PID\u6587\u4ef6\u5b58\u5728&#034;<br \/>\n            rm $PID_FILE<br \/>\n        fi<br \/>\n    else<br \/>\n        echo &#034;\u670d\u52a1\u672a\u8fd0\u884c&#034;<br \/>\n    fi<br \/>\n}<\/p>\n<p>case &#034;$1&#034; in<br \/>\n    start)<br \/>\n        start_service<br \/>\n        ;;<br \/>\n    stop)<br \/>\n        stop_service<br \/>\n        ;;<br \/>\n    restart)<br \/>\n        restart_service<br \/>\n        ;;<br \/>\n    status)<br \/>\n        check_status<br \/>\n        ;;<br \/>\n    *)<br \/>\n        echo &#034;\u4f7f\u7528\u65b9\u6cd5: $0 {start|stop|restart|status}&#034;<br \/>\n        exit 1<br \/>\n        ;;<br \/>\nesac<\/p>\n<p>\u4f7f\u7528\u65b9\u6cd5&#xff1a;<\/p>\n<p># \u7ed9\u811a\u672c\u6dfb\u52a0\u6267\u884c\u6743\u9650<br \/>\nchmod &#043;x service_manager.sh<\/p>\n<p># \u542f\u52a8\u670d\u52a1<br \/>\n.\/service_manager.sh start<\/p>\n<p># \u67e5\u770b\u72b6\u6001<br \/>\n.\/service_manager.sh status<\/p>\n<p># \u505c\u6b62\u670d\u52a1<br \/>\n.\/service_manager.sh stop<\/p>\n<p># \u91cd\u542f\u670d\u52a1<br \/>\n.\/service_manager.sh restart<\/p>\n<h3>6. \u5b9e\u9645\u5e94\u7528\u573a\u666f\u4e0e\u6548\u679c<\/h3>\n<h4>6.1 \u4f1a\u8bae\u5ba4\u624b\u673a\u4f7f\u7528\u7edf\u8ba1<\/h4>\n<p>\u6211\u6700\u8fd1\u5728\u4e00\u4e2a\u5ba2\u6237\u90a3\u91cc\u90e8\u7f72\u4e86\u8fd9\u4e2a\u7cfb\u7edf&#xff0c;\u7528\u6765\u7edf\u8ba1\u4f1a\u8bae\u5ba4\u4e2d\u624b\u673a\u7684\u4f7f\u7528\u60c5\u51b5\u3002\u4ed6\u4eec\u5728\u4f1a\u8bae\u5ba4\u5165\u53e3\u5b89\u88c5\u4e86\u6444\u50cf\u5934&#xff0c;\u901a\u8fc7\u6211\u4eec\u7684\u68c0\u6d4b\u7cfb\u7edf\u5b9e\u65f6\u5206\u6790&#xff1a;<\/p>\n<p>import time<br \/>\nfrom datetime import datetime<\/p>\n<p>class MeetingRoomMonitor:<br \/>\n    &#034;&#034;&#034;\u4f1a\u8bae\u5ba4\u624b\u673a\u4f7f\u7528\u76d1\u63a7\u5668&#034;&#034;&#034;<\/p>\n<p>    def __init__(self):<br \/>\n        self.detector &#061; None<br \/>\n        self.phone_count_history &#061; []<\/p>\n<p>    def initialize_detector(self):<br \/>\n        &#034;&#034;&#034;\u521d\u59cb\u5316\u68c0\u6d4b\u5668&#034;&#034;&#034;<br \/>\n        from modelscope.pipelines import pipeline<br \/>\n        from modelscope.utils.constant import Tasks<\/p>\n<p>        self.detector &#061; pipeline(<br \/>\n            Tasks.domain_specific_object_detection,<br \/>\n            model&#061;&#039;damo\/cv_tinynas_object-detection_damoyolo_phone&#039;,<br \/>\n            cache_dir&#061;&#039;\/root\/ai-models&#039;,<br \/>\n            trust_remote_code&#061;True<br \/>\n        )<\/p>\n<p>    def monitor_meeting_room(self, duration_minutes&#061;60, interval_seconds&#061;10):<br \/>\n        &#034;&#034;&#034;<br \/>\n        \u76d1\u63a7\u4f1a\u8bae\u5ba4\u4e00\u6bb5\u65f6\u95f4<\/p>\n<p>        \u53c2\u6570:<br \/>\n            duration_minutes: \u76d1\u63a7\u65f6\u957f&#xff08;\u5206\u949f&#xff09;<br \/>\n            interval_seconds: \u68c0\u6d4b\u95f4\u9694&#xff08;\u79d2&#xff09;<br \/>\n        &#034;&#034;&#034;<br \/>\n        if not self.detector:<br \/>\n            self.initialize_detector()<\/p>\n<p>        total_checks &#061; (duration_minutes * 60) \/\/ interval_seconds<br \/>\n        print(f&#034;\u5f00\u59cb\u76d1\u63a7&#xff0c;\u5c06\u6301\u7eed {duration_minutes} \u5206\u949f&#xff0c;\u6bcf {interval_seconds} \u79d2\u68c0\u6d4b\u4e00\u6b21&#034;)<\/p>\n<p>        for i in range(total_checks):<br \/>\n            # \u8fd9\u91cc\u5e94\u8be5\u662f\u4ece\u6444\u50cf\u5934\u83b7\u53d6\u56fe\u7247&#xff0c;\u793a\u4f8b\u4e2d\u4f7f\u7528\u9759\u6001\u56fe\u7247<br \/>\n            image_path &#061; &#034;meeting_room_snapshot.jpg&#034;<\/p>\n<p>            try:<br \/>\n                result &#061; self.detector(image_path)<br \/>\n                phone_count &#061; len(result[&#039;boxes&#039;])<\/p>\n<p>                # \u8bb0\u5f55\u7ed3\u679c<br \/>\n                timestamp &#061; datetime.now().strftime(&#034;%Y-%m-%d %H:%M:%S&#034;)<br \/>\n                self.phone_count_history.append({<br \/>\n                    &#039;time&#039;: timestamp,<br \/>\n                    &#039;count&#039;: phone_count<br \/>\n                })<\/p>\n<p>                print(f&#034;[{timestamp}] \u68c0\u6d4b\u5230 {phone_count} \u90e8\u624b\u673a&#034;)<\/p>\n<p>                # \u5982\u679c\u624b\u673a\u6570\u91cf\u8d85\u8fc7\u9608\u503c&#xff0c;\u53d1\u51fa\u63d0\u9192<br \/>\n                if phone_count &gt; 5:  # \u5047\u8bbe\u4f1a\u8bae\u5ba4\u6700\u591a\u5141\u8bb85\u90e8\u624b\u673a<br \/>\n                    self.send_alert(phone_count)<\/p>\n<p>            except Exception as e:<br \/>\n                print(f&#034;\u68c0\u6d4b\u5931\u8d25: {str(e)}&#034;)<\/p>\n<p>            # \u7b49\u5f85\u4e0b\u4e00\u6b21\u68c0\u6d4b<br \/>\n            time.sleep(interval_seconds)<\/p>\n<p>        # \u751f\u6210\u62a5\u544a<br \/>\n        self.generate_report()<\/p>\n<p>    def send_alert(self, phone_count):<br \/>\n        &#034;&#034;&#034;\u53d1\u9001\u63d0\u9192&#034;&#034;&#034;<br \/>\n        print(f&#034;\u26a0\ufe0f \u8b66\u544a: \u68c0\u6d4b\u5230 {phone_count} \u90e8\u624b\u673a&#xff0c;\u8d85\u8fc7\u9650\u5236&#xff01;&#034;)<br \/>\n        # \u8fd9\u91cc\u53ef\u4ee5\u6dfb\u52a0\u90ae\u4ef6\u3001\u77ed\u4fe1\u7b49\u901a\u77e5\u903b\u8f91<\/p>\n<p>    def generate_report(self):<br \/>\n        &#034;&#034;&#034;\u751f\u6210\u76d1\u63a7\u62a5\u544a&#034;&#034;&#034;<br \/>\n        if not self.phone_count_history:<br \/>\n            print(&#034;\u6ca1\u6709\u68c0\u6d4b\u6570\u636e&#034;)<br \/>\n            return<\/p>\n<p>        total_detections &#061; len(self.phone_count_history)<br \/>\n        max_phones &#061; max(item[&#039;count&#039;] for item in self.phone_count_history)<br \/>\n        avg_phones &#061; sum(item[&#039;count&#039;] for item in self.phone_count_history) \/ total_detections<\/p>\n<p>        print(&#034;\\\\n&#034; &#043; &#034;&#061;&#034;*50)<br \/>\n        print(&#034;\u4f1a\u8bae\u5ba4\u624b\u673a\u4f7f\u7528\u7edf\u8ba1\u62a5\u544a&#034;)<br \/>\n        print(&#034;&#061;&#034;*50)<br \/>\n        print(f&#034;\u76d1\u63a7\u65f6\u6bb5: {self.phone_count_history[0][&#039;time&#039;]} \u5230 {self.phone_count_history[-1][&#039;time&#039;]}&#034;)<br \/>\n        print(f&#034;\u68c0\u6d4b\u6b21\u6570: {total_detections}&#034;)<br \/>\n        print(f&#034;\u6700\u5927\u540c\u65f6\u4f7f\u7528\u624b\u673a\u6570: {max_phones}&#034;)<br \/>\n        print(f&#034;\u5e73\u5747\u624b\u673a\u4f7f\u7528\u6570: {avg_phones:.1f}&#034;)<br \/>\n        print(&#034;\\\\n\u65f6\u95f4\u7ebf:&#034;)<\/p>\n<p>        for item in self.phone_count_history[-10:]:  # \u663e\u793a\u6700\u540e10\u6b21\u68c0\u6d4b<br \/>\n            print(f&#034;  {item[&#039;time&#039;]}: {item[&#039;count&#039;]} \u90e8\u624b\u673a&#034;)<\/p>\n<h4>6.2 \u751f\u4ea7\u7ebf\u624b\u673a\u68c0\u6d4b<\/h4>\n<p>\u5728\u6709\u4e9b\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u4e0d\u5141\u8bb8\u643a\u5e26\u624b\u673a\u8fdb\u5165\u3002\u8fd9\u4e2a\u7cfb\u7edf\u53ef\u4ee5\u5b9e\u65f6\u68c0\u6d4b\u662f\u5426\u6709\u4eba\u8fdd\u89c4\u643a\u5e26\u624b\u673a&#xff1a;<\/p>\n<p>class ProductionLineMonitor:<br \/>\n    &#034;&#034;&#034;\u751f\u4ea7\u7ebf\u624b\u673a\u68c0\u6d4b\u76d1\u63a7&#034;&#034;&#034;<\/p>\n<p>    def __init__(self, camera_urls):<br \/>\n        &#034;&#034;&#034;<br \/>\n        \u521d\u59cb\u5316\u76d1\u63a7\u5668<\/p>\n<p>        \u53c2\u6570:<br \/>\n            camera_urls: \u6444\u50cf\u5934URL\u5217\u8868<br \/>\n        &#034;&#034;&#034;<br \/>\n        self.camera_urls &#061; camera_urls<br \/>\n        self.detector &#061; None<br \/>\n        self.violation_records &#061; []<\/p>\n<p>    def check_single_frame(self, frame):<br \/>\n        &#034;&#034;&#034;\u68c0\u67e5\u5355\u5e27\u56fe\u7247&#034;&#034;&#034;<br \/>\n        if not self.detector:<br \/>\n            self.initialize_detector()<\/p>\n<p>        result &#061; self.detector(frame)<br \/>\n        phones_detected &#061; len(result[&#039;boxes&#039;]) &gt; 0<\/p>\n<p>        if phones_detected:<br \/>\n            # \u8bb0\u5f55\u8fdd\u89c4\u4fe1\u606f<br \/>\n            violation_info &#061; {<br \/>\n                &#039;time&#039;: datetime.now().strftime(&#034;%Y-%m-%d %H:%M:%S&#034;),<br \/>\n                &#039;phone_count&#039;: len(result[&#039;boxes&#039;]),<br \/>\n                &#039;confidence_scores&#039;: [float(score) for score in result[&#039;scores&#039;]],<br \/>\n                &#039;frame&#039;: frame  # \u5b9e\u9645\u5e94\u7528\u4e2d\u53ef\u80fd\u53ea\u4fdd\u5b58\u8def\u5f84\u6216\u7f29\u7565\u56fe<br \/>\n            }<br \/>\n            self.violation_records.append(violation_info)<\/p>\n<p>            # \u4fdd\u5b58\u8bc1\u636e\u56fe\u7247<br \/>\n            self.save_evidence(frame, result)<\/p>\n<p>            return True, result<br \/>\n        else:<br \/>\n            return False, None<\/p>\n<p>    def save_evidence(self, frame, result):<br \/>\n        &#034;&#034;&#034;\u4fdd\u5b58\u8fdd\u89c4\u8bc1\u636e&#034;&#034;&#034;<br \/>\n        import cv2<\/p>\n<p>        # \u5728\u56fe\u7247\u4e0a\u7ed8\u5236\u68c0\u6d4b\u6846<br \/>\n        for box, score in zip(result[&#039;boxes&#039;], result[&#039;scores&#039;]):<br \/>\n            x1, y1, x2, y2 &#061; map(int, box)<br \/>\n            cv2.rectangle(frame, (x1, y1), (x2, y2), (0, 0, 255), 3)<br \/>\n            cv2.putText(frame, f&#034;Phone: {score:.2f}&#034;,<br \/>\n                       (x1, y1-10), cv2.FONT_HERSHEY_SIMPLEX,<br \/>\n                       1, (0, 0, 255), 2)<\/p>\n<p>        # \u4fdd\u5b58\u56fe\u7247<br \/>\n        timestamp &#061; datetime.now().strftime(&#034;%Y%m%d_%H%M%S&#034;)<br \/>\n        filename &#061; f&#034;violation_{timestamp}.jpg&#034;<br \/>\n        cv2.imwrite(filename, frame)<br \/>\n        print(f&#034;\u8fdd\u89c4\u8bc1\u636e\u5df2\u4fdd\u5b58: {filename}&#034;)<\/p>\n<h4>6.3 \u5b9e\u9645\u6d4b\u8bd5\u6548\u679c<\/h4>\n<p>\u6211\u5728\u51e0\u53f0\u4e0d\u540c\u914d\u7f6e\u7684\u670d\u52a1\u5668\u4e0a\u6d4b\u8bd5\u4e86\u8fd9\u4e2a\u6a21\u578b&#xff1a;<\/p>\n<p>\u6d4b\u8bd5\u73af\u58831&#xff1a;\u4f4e\u914d\u4e91\u670d\u52a1\u5668<\/p>\n<ul>\n<li>CPU: 2\u6838<\/li>\n<li>\u5185\u5b58: 4GB<\/li>\n<li>\u7cfb\u7edf: Ubuntu 20.04<\/li>\n<li>\u5904\u7406\u901f\u5ea6: \u7ea615\u5e27\/\u79d2&#xff08;CPU\u6a21\u5f0f&#xff09;<\/li>\n<\/ul>\n<p>\u6d4b\u8bd5\u73af\u58832&#xff1a;\u8001\u65e7\u529e\u516c\u7535\u8111<\/p>\n<ul>\n<li>CPU: Intel i5-3470&#xff08;2012\u5e74&#xff09;<\/li>\n<li>\u5185\u5b58: 8GB DDR3<\/li>\n<li>\u7cfb\u7edf: Ubuntu 18.04<\/li>\n<li>\u5904\u7406\u901f\u5ea6: \u7ea622\u5e27\/\u79d2&#xff08;CPU\u6a21\u5f0f&#xff09;<\/li>\n<\/ul>\n<p>\u6d4b\u8bd5\u73af\u58833&#xff1a;\u6811\u8393\u6d3e4B<\/p>\n<ul>\n<li>CPU: ARM Cortex-A72<\/li>\n<li>\u5185\u5b58: 4GB<\/li>\n<li>\u7cfb\u7edf: Raspberry Pi OS<\/li>\n<li>\u5904\u7406\u901f\u5ea6: \u7ea68\u5e27\/\u79d2&#xff08;CPU\u6a21\u5f0f&#xff09;<\/li>\n<\/ul>\n<p>\u4ece\u6d4b\u8bd5\u7ed3\u679c\u53ef\u4ee5\u770b\u51fa&#xff0c;\u5373\u4f7f\u5728\u6811\u8393\u6d3e\u8fd9\u6837\u7684\u5d4c\u5165\u5f0f\u8bbe\u5907\u4e0a&#xff0c;\u4e5f\u80fd\u8fbe\u5230\u63a5\u8fd1\u5b9e\u65f6\u7684\u68c0\u6d4b\u901f\u5ea6\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u76d1\u63a7\u573a\u666f&#xff08;\u901a\u5e38\u9700\u898115-25\u5e27\/\u79d2&#xff09;&#xff0c;\u8fd9\u4e2a\u6027\u80fd\u5b8c\u5168\u8db3\u591f\u3002<\/p>\n<h3>7. \u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h3>\n<h4>7.1 \u90e8\u7f72\u5e38\u89c1\u95ee\u9898<\/h4>\n<p>\u95ee\u98981&#xff1a;\u5185\u5b58\u4e0d\u8db3\u9519\u8bef<\/p>\n<p>RuntimeError: CUDA out of memory<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<ul>\n<li>\u4f7f\u7528CPU\u6a21\u5f0f\u8fd0\u884c&#xff1a;\u5728\u4ee3\u7801\u4e2d\u6dfb\u52a0device&#061;&#039;cpu&#039;\u53c2\u6570<\/li>\n<li>\u51cf\u5c0f\u56fe\u7247\u8f93\u5165\u5c3a\u5bf8<\/li>\n<li>\u4f7f\u7528\u4e0a\u9762\u63d0\u5230\u7684\u5185\u5b58\u4f18\u5316\u6280\u5de7<\/li>\n<\/ul>\n<p>\u95ee\u98982&#xff1a;\u6a21\u578b\u4e0b\u8f7d\u5931\u8d25<\/p>\n<p>ConnectionError: Failed to download model<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<ul>\n<li>\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5<\/li>\n<li>\u4f7f\u7528\u56fd\u5185\u955c\u50cf\u6e90<\/li>\n<li>\u624b\u52a8\u4e0b\u8f7d\u6a21\u578b\u6587\u4ef6\u5230\u7f13\u5b58\u76ee\u5f55<\/li>\n<\/ul>\n<p>\u95ee\u98983&#xff1a;\u7aef\u53e3\u88ab\u5360\u7528<\/p>\n<p>OSError: [Errno 98] Address already in use<\/p>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<ul>\n<li>\u66f4\u6539\u670d\u52a1\u7aef\u53e3&#xff1a;\u4fee\u6539app.py\u4e2d\u7684\u7aef\u53e3\u53f7<\/li>\n<li>\u505c\u6b62\u5360\u7528\u7aef\u53e3\u7684\u8fdb\u7a0b&#xff1a;sudo lsof -i :7860\u7136\u540ekill -9 &lt;PID&gt;<\/li>\n<\/ul>\n<h4>7.2 \u4f7f\u7528\u4e2d\u7684\u95ee\u9898<\/h4>\n<p>\u95ee\u9898&#xff1a;\u68c0\u6d4b\u7ed3\u679c\u4e0d\u51c6\u786e \u53ef\u80fd\u539f\u56e0\u548c\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<li>\u56fe\u7247\u8d28\u91cf\u592a\u5dee&#xff1a;\u786e\u4fdd\u56fe\u7247\u6e05\u6670&#xff0c;\u5149\u7ebf\u5145\u8db3<\/li>\n<li>\u624b\u673a\u89d2\u5ea6\u7279\u6b8a&#xff1a;\u5c1d\u8bd5\u4ece\u4e0d\u540c\u89d2\u5ea6\u62cd\u6444<\/li>\n<li>\u7f6e\u4fe1\u5ea6\u9608\u503c\u4e0d\u5408\u9002&#xff1a;\u8c03\u6574\u68c0\u6d4b\u9608\u503c<\/li>\n<li>\u6a21\u578b\u7248\u672c\u95ee\u9898&#xff1a;\u786e\u4fdd\u4f7f\u7528\u7684\u662f\u6700\u65b0\u7248\u672c<\/li>\n<p>\u8c03\u6574\u7f6e\u4fe1\u5ea6\u9608\u503c\u7684\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/p>\n<p>def detect_with_threshold(image_path, confidence_threshold&#061;0.5):<br \/>\n    &#034;&#034;&#034;\u4f7f\u7528\u81ea\u5b9a\u4e49\u7f6e\u4fe1\u5ea6\u9608\u503c\u8fdb\u884c\u68c0\u6d4b&#034;&#034;&#034;<br \/>\n    detector &#061; pipeline(<br \/>\n        Tasks.domain_specific_object_detection,<br \/>\n        model&#061;&#039;damo\/cv_tinynas_object-detection_damoyolo_phone&#039;,<br \/>\n        cache_dir&#061;&#039;\/root\/ai-models&#039;,<br \/>\n        trust_remote_code&#061;True<br \/>\n    )<\/p>\n<p>    result &#061; detector(image_path)<\/p>\n<p>    # \u8fc7\u6ee4\u4f4e\u7f6e\u4fe1\u5ea6\u7684\u7ed3\u679c<br \/>\n    filtered_boxes &#061; []<br \/>\n    filtered_scores &#061; []<\/p>\n<p>    for box, score in zip(result[&#039;boxes&#039;], result[&#039;scores&#039;]):<br \/>\n        if score &gt;&#061; confidence_threshold:<br \/>\n            filtered_boxes.append(box)<br \/>\n            filtered_scores.append(score)<\/p>\n<p>    return {<br \/>\n        &#039;boxes&#039;: filtered_boxes,<br \/>\n        &#039;scores&#039;: filtered_scores,<br \/>\n        &#039;original_count&#039;: len(result[&#039;boxes&#039;]),<br \/>\n        &#039;filtered_count&#039;: len(filtered_boxes)<br \/>\n    }<\/p>\n<h4>7.3 \u6027\u80fd\u4f18\u5316\u5efa\u8bae<\/h4>\n<p>\u5982\u679c\u4f60\u53d1\u73b0\u68c0\u6d4b\u901f\u5ea6\u4e0d\u591f\u5feb&#xff0c;\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u4f18\u5316&#xff1a;<\/p>\n<li>\u4f7f\u7528\u66f4\u5c0f\u7684\u8f93\u5165\u5c3a\u5bf8&#xff1a;\u5c06\u56fe\u7247resize\u5230640&#215;640\u6216\u66f4\u5c0f<\/li>\n<li>\u6279\u91cf\u5904\u7406&#xff1a;\u4e00\u6b21\u5904\u7406\u591a\u5f20\u56fe\u7247&#xff08;\u5982\u679c\u6709\u8db3\u591f\u5185\u5b58&#xff09;<\/li>\n<li>\u542f\u7528GPU\u52a0\u901f&#xff1a;\u5982\u679c\u6709NVIDIA\u663e\u5361&#xff0c;\u5b89\u88c5CUDA\u7248\u672c\u7684PyTorch<\/li>\n<li>\u4f7f\u7528TensorRT\u52a0\u901f&#xff1a;\u5982\u679c\u662f\u5728NVIDIA\u8bbe\u5907\u4e0a\u90e8\u7f72&#xff0c;\u53ef\u4ee5\u8f6c\u6362\u4e3aTensorRT\u683c\u5f0f<\/li>\n<p>GPU\u52a0\u901f\u7684\u4ee3\u7801\u793a\u4f8b&#xff1a;<\/p>\n<p>def detect_with_gpu(image_path):<br \/>\n    &#034;&#034;&#034;\u4f7f\u7528GPU\u52a0\u901f\u68c0\u6d4b&#034;&#034;&#034;<br \/>\n    import torch<\/p>\n<p>    # \u68c0\u67e5GPU\u662f\u5426\u53ef\u7528<br \/>\n    if not torch.cuda.is_available():<br \/>\n        print(&#034;\u8b66\u544a: GPU\u4e0d\u53ef\u7528&#xff0c;\u5c06\u4f7f\u7528CPU&#034;)<br \/>\n        device &#061; &#039;cpu&#039;<br \/>\n    else:<br \/>\n        device &#061; &#039;cuda:0&#039;<br \/>\n        print(f&#034;\u4f7f\u7528GPU: {torch.cuda.get_device_name(0)}&#034;)<\/p>\n<p>    detector &#061; pipeline(<br \/>\n        Tasks.domain_specific_object_detection,<br \/>\n        model&#061;&#039;damo\/cv_tinynas_object-detection_damoyolo_phone&#039;,<br \/>\n        cache_dir&#061;&#039;\/root\/ai-models&#039;,<br \/>\n        trust_remote_code&#061;True,<br \/>\n        device&#061;device  # \u6307\u5b9a\u4f7f\u7528GPU<br \/>\n    )<\/p>\n<p>    return detector(image_path)<\/p>\n<h3>8. \u603b\u7ed3<\/h3>\n<p>\u901a\u8fc7\u4eca\u5929\u7684\u5206\u4eab&#xff0c;\u4f60\u5e94\u8be5\u5df2\u7ecf\u638c\u63e1\u4e86\u5982\u4f55\u5728\u4f4e\u914d\u7f6e\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u548c\u4f7f\u7528\u8fd9\u4e2a125MB\u7684\u8f7b\u91cf\u7ea7\u624b\u673a\u68c0\u6d4b\u6a21\u578b\u3002\u6211\u4eec\u6765\u56de\u987e\u4e00\u4e0b\u5173\u952e\u70b9&#xff1a;<\/p>\n<p>\u6a21\u578b\u4f18\u52bf\u660e\u663e&#xff1a;<\/p>\n<ul>\n<li>\u53ea\u6709125MB\u5927\u5c0f&#xff0c;\u5bf9\u786c\u4ef6\u8981\u6c42\u6781\u4f4e<\/li>\n<li>88.8%\u7684\u51c6\u786e\u7387&#xff0c;\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u8868\u73b0\u53ef\u9760<\/li>\n<li>3.83\u6beb\u79d2\u7684\u63a8\u7406\u901f\u5ea6&#xff0c;\u6ee1\u8db3\u5b9e\u65f6\u6027\u8981\u6c42<\/li>\n<li>\u4e13\u95e8\u9488\u5bf9\u624b\u673a\u68c0\u6d4b\u4f18\u5316&#xff0c;\u6548\u679c\u6bd4\u901a\u7528\u6a21\u578b\u66f4\u597d<\/li>\n<\/ul>\n<p>\u90e8\u7f72\u4f7f\u7528\u7b80\u5355&#xff1a;<\/p>\n<ul>\n<li>\u63d0\u4f9b\u4e86Web\u754c\u9762\u548cPython API\u4e24\u79cd\u4f7f\u7528\u65b9\u5f0f<\/li>\n<li>\u4e00\u952e\u542f\u52a8\u811a\u672c&#xff0c;\u90e8\u7f72\u8fc7\u7a0b\u7b80\u5355\u5feb\u6377<\/li>\n<li>\u5b8c\u5584\u7684\u9519\u8bef\u5904\u7406\u548c\u65e5\u5fd7\u8bb0\u5f55<\/li>\n<\/ul>\n<p>\u9002\u7528\u573a\u666f\u5e7f\u6cdb&#xff1a;<\/p>\n<ul>\n<li>\u4f1a\u8bae\u5ba4\u3001\u56fe\u4e66\u9986\u7b49\u573a\u6240\u7684\u624b\u673a\u4f7f\u7528\u76d1\u63a7<\/li>\n<li>\u751f\u4ea7\u7ebf\u3001\u5b9e\u9a8c\u5ba4\u7b49\u533a\u57df\u7684\u624b\u673a\u7981\u5165\u68c0\u6d4b<\/li>\n<li>\u5546\u573a\u3001\u8f66\u7ad9\u7b49\u516c\u5171\u573a\u6240\u7684\u4eba\u6d41\u5206\u6790<\/li>\n<li>\u4efb\u4f55\u9700\u8981\u81ea\u52a8\u68c0\u6d4b\u624b\u673a\u7684\u573a\u5408<\/li>\n<\/ul>\n<p>\u8d44\u6e90\u6d88\u8017\u6781\u4f4e&#xff1a;<\/p>\n<ul>\n<li>\u57284GB\u5185\u5b58\u7684\u670d\u52a1\u5668\u4e0a\u6d41\u7545\u8fd0\u884c<\/li>\n<li>\u6811\u8393\u6d3e\u7b49\u5d4c\u5165\u5f0f\u8bbe\u5907\u4e5f\u80fd\u4f7f\u7528<\/li>\n<li>\u957f\u671f\u8fd0\u884c\u7a33\u5b9a&#xff0c;\u5185\u5b58\u6cc4\u6f0f\u98ce\u9669\u5c0f<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u9879\u76ee\u7684\u4ef7\u503c\u5728\u4e8e\u5b83\u8bc1\u660e\u4e86&#xff0c;\u5373\u4f7f\u6ca1\u6709\u9ad8\u7aef\u786c\u4ef6&#xff0c;\u4e5f\u80fd\u5b9e\u73b0\u9ad8\u8d28\u91cf\u7684AI\u5e94\u7528\u3002125MB\u7684\u6a21\u578b\u5927\u5c0f&#xff0c;\u8ba9\u624b\u673a\u68c0\u6d4b\u8fd9\u4e2a\u529f\u80fd\u53ef\u4ee5\u90e8\u7f72\u5230\u51e0\u4e4e\u4efb\u4f55\u8bbe\u5907\u4e0a&#xff0c;\u5927\u5927\u964d\u4f4e\u4e86AI\u6280\u672f\u7684\u4f7f\u7528\u95e8\u69db\u3002<\/p>\n<p>\u5982\u679c\u4f60\u6b63\u5728\u5bfb\u627e\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u3001\u9ad8\u6027\u80fd\u7684\u624b\u673a\u68c0\u6d4b\u89e3\u51b3\u65b9\u6848&#xff0c;\u4e0d\u59a8\u8bd5\u8bd5\u8fd9\u4e2a\u6a21\u578b\u3002\u5b83\u53ef\u80fd\u4e0d\u662f\u529f\u80fd\u6700\u5168\u7684&#xff0c;\u4e5f\u4e0d\u662f\u51c6\u786e\u7387\u6700\u9ad8\u7684&#xff0c;\u4f46\u5728\u6027\u4ef7\u6bd4\u548c\u5b9e\u7528\u6027\u65b9\u9762&#xff0c;\u5b83\u7edd\u5bf9\u662f\u4e00\u4e2a\u4f18\u79c0\u7684\u9009\u62e9\u3002<\/p>\n<hr \/>\n<p>\u83b7\u53d6\u66f4\u591aAI\u955c\u50cf<\/p>\n<p>\u60f3\u63a2\u7d22\u66f4\u591aAI\u955c\u50cf\u548c\u5e94\u7528\u573a\u666f&#xff1f;\u8bbf\u95ee CSDN\u661f\u56fe\u955c\u50cf\u5e7f\u573a&#xff0c;\u63d0\u4f9b\u4e30\u5bcc\u7684\u9884\u7f6e\u955c\u50cf&#xff0c;\u8986\u76d6\u5927\u6a21\u578b\u63a8\u7406\u3001\u56fe\u50cf\u751f\u6210\u3001\u89c6\u9891\u751f\u6210\u3001\u6a21\u578b\u5fae\u8c03\u7b49\u591a\u4e2a\u9886\u57df&#xff0c;\u652f\u6301\u4e00\u952e\u90e8\u7f72\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72&#xff1a;125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5<br \/>\n1. \u5f15\u8a00<br \/>\n\u4f60\u6709\u6ca1\u6709\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1f;\u60f3\u5728\u4f1a\u8bae\u5ba4\u3001\u56fe\u4e66\u9986\u6216\u8005\u751f\u4ea7\u7ebf\u4e0a\u90e8\u7f72\u4e00\u4e2a\u624b\u673a\u68c0\u6d4b\u7cfb\u7edf&#xff0c;\u7528\u6765\u7edf\u8ba1\u624b\u673a\u4f7f\u7528\u60c5\u51b5\u6216\u8005\u786e\u4fdd\u7279\u5b9a\u533a\u57df\u7684\u5b89\u5168&#xff0c;\u7ed3\u679c\u53d1\u73b0\u670d\u52a1\u5668\u914d\u7f6e\u592a\u4f4e&#xff0c;\u8dd1\u4e0d\u52a8\u90a3\u4e9b\u52a8\u8f84\u51e0\u4e2aG\u7684\u68c0\u6d4b\u6a21\u578b\u3002<br \/>\n\u6211\u4e4b\u524d\u5c31\u78b0\u5230\u8fc7\u8fd9\u4e2a\u95ee\u9898\u3002\u5ba2\u6237\u6709\u4e00\u53f0\u8001\u65e7\u7684\u670d\u52a1\u5668&#xff0c;\u5185\u5b58\u53ea\u67094GB&#xff0c;CPU\u4e5f\u662f\u597d\u51e0\u5e74\u524d\u7684\u578b\u53f7&#xff0c;\u4f46\u9700\u8981\u5728\u5165\u53e3\u5904<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7591,9826,1665,523],"topic":[],"class_list":["post-86987","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-9826","tag-1665","tag-523"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72\uff1a125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/86987.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72\uff1a125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72&#xff1a;125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5 1. \u5f15\u8a00 \u4f60\u6709\u6ca1\u6709\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1f;\u60f3\u5728\u4f1a\u8bae\u5ba4\u3001\u56fe\u4e66\u9986\u6216\u8005\u751f\u4ea7\u7ebf\u4e0a\u90e8\u7f72\u4e00\u4e2a\u624b\u673a\u68c0\u6d4b\u7cfb\u7edf&#xff0c;\u7528\u6765\u7edf\u8ba1\u624b\u673a\u4f7f\u7528\u60c5\u51b5\u6216\u8005\u786e\u4fdd\u7279\u5b9a\u533a\u57df\u7684\u5b89\u5168&#xff0c;\u7ed3\u679c\u53d1\u73b0\u670d\u52a1\u5668\u914d\u7f6e\u592a\u4f4e&#xff0c;\u8dd1\u4e0d\u52a8\u90a3\u4e9b\u52a8\u8f84\u51e0\u4e2aG\u7684\u68c0\u6d4b\u6a21\u578b\u3002 \u6211\u4e4b\u524d\u5c31\u78b0\u5230\u8fc7\u8fd9\u4e2a\u95ee\u9898\u3002\u5ba2\u6237\u6709\u4e00\u53f0\u8001\u65e7\u7684\u670d\u52a1\u5668&#xff0c;\u5185\u5b58\u53ea\u67094GB&#xff0c;CPU\u4e5f\u662f\u597d\u51e0\u5e74\u524d\u7684\u578b\u53f7&#xff0c;\u4f46\u9700\u8981\u5728\u5165\u53e3\u5904\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/86987.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-29T07:40:47+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86987.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/86987.html\",\"name\":\"\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72\uff1a125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-29T07:40:47+00:00\",\"dateModified\":\"2026-07-29T07:40:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/86987.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/86987.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86987.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72\uff1a125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72\uff1a125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/86987.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72\uff1a125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72&#xff1a;125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5 1. \u5f15\u8a00 \u4f60\u6709\u6ca1\u6709\u9047\u5230\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1f;\u60f3\u5728\u4f1a\u8bae\u5ba4\u3001\u56fe\u4e66\u9986\u6216\u8005\u751f\u4ea7\u7ebf\u4e0a\u90e8\u7f72\u4e00\u4e2a\u624b\u673a\u68c0\u6d4b\u7cfb\u7edf&#xff0c;\u7528\u6765\u7edf\u8ba1\u624b\u673a\u4f7f\u7528\u60c5\u51b5\u6216\u8005\u786e\u4fdd\u7279\u5b9a\u533a\u57df\u7684\u5b89\u5168&#xff0c;\u7ed3\u679c\u53d1\u73b0\u670d\u52a1\u5668\u914d\u7f6e\u592a\u4f4e&#xff0c;\u8dd1\u4e0d\u52a8\u90a3\u4e9b\u52a8\u8f84\u51e0\u4e2aG\u7684\u68c0\u6d4b\u6a21\u578b\u3002 \u6211\u4e4b\u524d\u5c31\u78b0\u5230\u8fc7\u8fd9\u4e2a\u95ee\u9898\u3002\u5ba2\u6237\u6709\u4e00\u53f0\u8001\u65e7\u7684\u670d\u52a1\u5668&#xff0c;\u5185\u5b58\u53ea\u67094GB&#xff0c;CPU\u4e5f\u662f\u597d\u51e0\u5e74\u524d\u7684\u578b\u53f7&#xff0c;\u4f46\u9700\u8981\u5728\u5165\u53e3\u5904","og_url":"https:\/\/www.wsisp.com\/helps\/86987.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-29T07:40:47+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/86987.html","url":"https:\/\/www.wsisp.com\/helps\/86987.html","name":"\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72\uff1a125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-29T07:40:47+00:00","dateModified":"2026-07-29T07:40:47+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/86987.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/86987.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/86987.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5b9e\u65f6\u624b\u673a\u68c0\u6d4b-\u901a\u7528\u955c\u50cf\u90e8\u7f72\uff1a125MB\u8f7b\u91cf\u6a21\u578b\u9002\u914d\u4f4e\u914d\u670d\u52a1\u5668\u5b9e\u8df5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=86987"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86987\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=86987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=86987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=86987"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=86987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}