{"id":559,"date":"2026-11-08T20:13:07","date_gmt":"2026-11-08T12:13:07","guid":{"rendered":"https:\/\/bj.ci\/?p=559"},"modified":"2026-11-09T19:46:35","modified_gmt":"2026-11-09T11:46:35","slug":"rembg%ef%bc%9a%e6%8a%8a%e7%85%a7%e7%89%87%e9%87%8c%e7%9a%84%e4%b8%bb%e4%bd%93%e5%8d%95%e7%8b%ac%e6%8b%bf%e5%87%ba%e6%9d%a5","status":"publish","type":"post","link":"https:\/\/bj.ci\/?p=559","title":{"rendered":"rembg\uff1a\u628a\u7167\u7247\u91cc\u7684\u4e3b\u4f53\u5355\u72ec\u62ff\u51fa\u6765"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u505a\u4e00\u5f20\u4ecb\u7ecd\u5361\u7247\uff0c\u53ea\u60f3\u7559\u4e0b\u7167\u7247\u91cc\u7684\u676f\u5b50\u3001\u690d\u7269\u6216\u4eba\u7269\uff0c\u539f\u6765\u7684\u684c\u9762\u548c\u5899\u58c1\u5374\u4e00\u8d77\u8ddf\u7740\u8fc7\u6765\u4e86\u3002rembg \u53ef\u4ee5\u7528 AI \u6a21\u578b\u53bb\u9664\u56fe\u7247\u80cc\u666f\uff0c\u751f\u6210\u900f\u660e\u80cc\u666f\u7684 PNG\uff0c\u518d\u62ff\u53bb\u6392\u7248\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b83\u66f4\u9002\u5408\u613f\u610f\u7528\u7ec8\u7aef\u3001\u9700\u8981\u53cd\u590d\u5904\u7406\u56fe\u7247\u7684\u4eba\u3002\u4e0b\u9762\u4ecb\u7ecd\u7684\u662f\u672c\u673a\u547d\u4ee4\u884c\u7528\u6cd5\u3002\u6309\u8be5\u7248\u5b98\u65b9\u8bf4\u660e\uff0c\u9700\u8981\u5148\u51c6\u5907 Python 3.11\u20143.13\uff1b\u4e0d\u719f\u6089 Python \u5b89\u88c5\u7684\u8bdd\uff0c\u5b83\u5e76\u4e0d\u7b97\u62ff\u6765\u5c31\u80fd\u70b9\u7684\u4fee\u56fe\u8f6f\u4ef6\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5148\u7528\u4e00\u5f20\u7167\u7247\u8bd5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5df2\u6709\u5408\u9002\u7684 Python \u73af\u5883\u540e\uff0c\u6309\u9879\u76ee\u8bf4\u660e\u5b89\u88c5 CPU \u7248\u5373\u53ef\uff0c\u4e0d\u5fc5\u5148\u6298\u817e\u663e\u5361\u3002\u672c\u6587\u5bf9\u5e94 2.0.87 \u7248\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install \"rembg[cpu,cli]==2.0.87\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u56fe\u7247\u6240\u5728\u7684\u6587\u4ef6\u5939\u6253\u5f00\u7ec8\u7aef\u3002\u4e0b\u9762\u4ee5\u5df2\u6709\u7684 input.png \u4e3a\u4f8b\uff0c\u8fd0\u884c\u65f6\u628a\u5b83\u6362\u6210\u771f\u5b9e\u6587\u4ef6\u540d\uff1b\u4e0d\u8981\u53ea\u6539\u6269\u5c55\u540d\u6765\u8f6c\u6362\u56fe\u7247\u683c\u5f0f\u3002\u6587\u4ef6\u540d\u542b\u7a7a\u683c\u65f6\uff0c\u7528\u82f1\u6587\u53cc\u5f15\u53f7\u62ec\u8d77\u6765\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rembg i -m u2net input.png output.png<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u7684 i \u8868\u793a\u5904\u7406\u5355\u5f20\u56fe\u7247\uff0c-m u2net \u662f\u660e\u786e\u9009\u7528 U\u00b2-Net \u6a21\u578b\uff1boutput.png \u662f\u53e6\u5b58\u7684\u7ed3\u679c\uff0c\u4e0d\u8981\u4e0e\u539f\u56fe\u540c\u540d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u6b21\u4f7f\u7528\u4f1a\u4e0b\u8f7d\u6a21\u578b\uff0c\u5b89\u88c5\u5305\u548c\u6a21\u578b\u90fd\u9700\u8981\u7f51\u7edc\u53ef\u8fbe\uff0c\u56fd\u5185\u4e0b\u8f7d\u662f\u5426\u987a\u5229\u8981\u770b\u5b9e\u9645\u7f51\u7edc\u3002\u6309\u8fd9\u6761\u672c\u5730\u6a21\u578b\u547d\u4ee4\u5904\u7406\u56fe\u7247\uff0c\u4e0d\u9700\u8981\u586b\u4e91\u670d\u52a1 API \u5bc6\u94a5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5148\u628a\u7ed3\u679c\u653e\u5230\u6d45\u8272\u3001\u6df1\u8272\u5e95\u4e0a\u5404\u770b\u4e00\u904d\uff1a\u4e3b\u4f53\u6709\u6ca1\u6709\u88ab\u5207\u6389\uff0c\u676f\u628a\u4e2d\u95f4\u6709\u6ca1\u6709\u6b8b\u7559\u80cc\u666f\uff0c\u5934\u53d1\u8fb9\u7f18\u662f\u5426\u9700\u8981\u4fee\u6574\u3002\u80fd\u8f93\u51fa\u6587\u4ef6\u4e0d\u4ee3\u8868\u62a0\u5f97\u5408\u7528\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u8981\u62ff\u7ed3\u679c\u505a\u5546\u54c1\u56fe\uff0c\u53ef\u4ee5\u5bf9\u7167<a href=\"https:\/\/bj.ci\/?p=429\">\u300aAI\u4fee\u56fe\u8d8a\u6539\u8d8a\u504f\uff0c\u522b\u6025\u7740\u8ba9\u5b83\u518d\u8bd5\u4e00\u6b21\u300b<\/a>\u91cc\u7684\u53ef\u590d\u5236\u68c0\u67e5\u6e05\u5355\uff0c\u518d\u6838\u5305\u88c5\u6587\u5b57\u3001\u5546\u54c1\u8f6e\u5ed3\u548c\u5904\u7406\u8fb9\u7f18\u3002\u6e05\u5355\u53ea\u662f\u4eba\u5de5\u6838\u5bf9\u63d0\u793a\uff0c\u4ecd\u9700\u9010\u5f20\u68c0\u67e5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u786e\u8ba4\u6837\u7247\u9002\u5408\u81ea\u5df1\u7684\u7528\u9014\uff0c\u518d\u6279\u91cf\u5904\u7406\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rembg p -m u2net input-folder output-folder<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">p \u8868\u793a\u5904\u7406\u6587\u4ef6\u5939\u3002\u628a input-folder \u6362\u6210\u539f\u56fe\u76ee\u5f55\uff0coutput-folder \u6362\u6210\u4e00\u4e2a\u7a7a\u7684\u7ed3\u679c\u76ee\u5f55\uff0c\u539f\u56fe\u53e6\u5916\u7559\u597d\u3002\u6279\u91cf\u524d\u68c0\u67e5\u6587\u4ef6\u540d\uff1a\u4e0d\u540c\u5b50\u6587\u4ef6\u5939\u7684\u540c\u540d\u56fe\u7247\uff0c\u6216\u4ec5\u6269\u5c55\u540d\u4e0d\u540c\u7684\u540c\u540d\u56fe\u7247\uff0c\u4f1a\u5bf9\u5e94\u540c\u4e00\u4e2a PNG \u7ed3\u679c\uff1b\u8be5\u7248\u4f1a\u8df3\u8fc7\u5df2\u6709\u7ed3\u679c\uff0c\u4e0d\u4f1a\u81ea\u52a8\u66ff\u4f60\u91cd\u547d\u540d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6a21\u578b\u540d\u5b57\u522b\u7701\u7565<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">rembg \u7684\u7a0b\u5e8f\u91c7\u7528 MIT \u8bb8\u53ef\uff0c\u4f46\u5b83\u8c03\u7528\u7684\u6a21\u578b\u5404\u6709\u6761\u6b3e\u30022.0.87 \u6587\u6863\u5217\u51fa\u7684\u9ed8\u8ba4\u6a21\u578b\u662f BRIA RMBG-2.0\uff0c\u5546\u4e1a\u4f7f\u7528\u9700\u8981\u4e0e BRIA \u53e6\u7b7e\u534f\u8bae\u3002\u4e0d\u80fd\u770b\u5230\u7a0b\u5e8f\u5f00\u6e90\uff0c\u5c31\u8ba4\u5b9a\u6240\u6709\u6a21\u578b\u90fd\u53ef\u514d\u8d39\u5546\u7528\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u9762\u7684\u547d\u4ee4\u7279\u610f\u5199\u660e u2net\uff1bU\u00b2-Net \u539f\u4ed3\u5e93\u6807\u6ce8 Apache-2.0\u3002\u7528\u4e8e\u5546\u4e1a\u7d20\u6750\u524d\uff0c\u4ecd\u5e94\u6838\u5bf9\u6240\u9009\u6a21\u578b\u548c\u7167\u7247\u672c\u8eab\u7684\u4f7f\u7528\u6743\u3002\u82e5\u6539\u7528 withoutbg\u3001atlascloud \u7b49\u4e91\u7aef\u9009\u9879\uff0c\u56fe\u7247\u4f1a\u4f20\u5230\u5bf9\u5e94\u670d\u52a1\u5546\uff0c\u5e76\u53d7\u5176\u8d26\u53f7\u3001\u8d39\u7528\u4e0e\u6570\u636e\u5904\u7406\u6761\u6b3e\u7ea6\u675f\uff0c\u4e0d\u80fd\u518d\u6309\u672c\u5730\u5904\u7406\u7406\u89e3\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6587\u4f9d\u636e 2026 \u5e74 11 \u6708 8 \u65e5\u6838\u8bfb\u7684\u5b98\u65b9\u6587\u6863\u6574\u7406\uff0c\u672a\u5b89\u88c5\u5b9e\u6d4b\u3002\u5b83\u89e3\u51b3\u7684\u662f\u53bb\u80cc\u666f\u8fd9\u4e00\u6b65\uff0c\u662f\u5426\u4fdd\u4f4f\u4e86\u9700\u8981\u7684\u7ec6\u8282\uff0c\u4ecd\u8981\u770b\u5177\u4f53\u56fe\u7247\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6765\u6e90\uff1a<a href=\"https:\/\/github.com\/danielgatis\/rembg\/blob\/v2.0.87\/README.md\">rembg 2.0.87 \u8bf4\u660e<\/a>\u3001<a href=\"https:\/\/github.com\/danielgatis\/rembg\/blob\/v2.0.87\/rembg\/commands\/i_command.py\">\u5355\u56fe\u547d\u4ee4\u5b9e\u73b0<\/a>\u3001<a href=\"https:\/\/github.com\/danielgatis\/rembg\/blob\/v2.0.87\/rembg\/commands\/p_command.py\">\u6279\u91cf\u547d\u4ee4\u5b9e\u73b0<\/a>\u3001<a href=\"https:\/\/github.com\/xuebinqin\/U-2-Net\">U\u00b2-Net \u53ca\u8bb8\u53ef<\/a>\u3001<a href=\"https:\/\/huggingface.co\/briaai\/RMBG-2.0\">BRIA RMBG-2.0 \u6a21\u578b\u8bf4\u660e<\/a>\u3002<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>\u60f3\u628a\u7167\u7247\u91cc\u7684\u4e3b\u4f53\u653e\u8fdb\u5361\u7247\u6216\u6f14\u793a\u7a3f\uff0c\u53ef\u4ee5\u4e86\u89e3 rembg \u7684\u672c\u5730\u53bb\u80cc\u666f\u7528\u6cd5\u3002\u5148\u5904\u7406\u4e00\u5f20\uff0c\u518d\u6279\u91cf\u8f93\u51fa\uff1b\u6a21\u578b\u9009\u62e9\u3001\u4e0b\u8f7d\u6761\u4ef6\u548c\u5546\u7528\u8bb8\u53ef\u4e5f\u8981\u4e00\u8d77\u770b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[70],"tags":[84],"class_list":["post-559","post","type-post","status-publish","format-standard","hentry","category-open-source-tools","tag-rembg"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/bj.ci\/index.php?rest_route=\/wp\/v2\/posts\/559","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bj.ci\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bj.ci\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bj.ci\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bj.ci\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=559"}],"version-history":[{"count":2,"href":"https:\/\/bj.ci\/index.php?rest_route=\/wp\/v2\/posts\/559\/revisions"}],"predecessor-version":[{"id":582,"href":"https:\/\/bj.ci\/index.php?rest_route=\/wp\/v2\/posts\/559\/revisions\/582"}],"wp:attachment":[{"href":"https:\/\/bj.ci\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bj.ci\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bj.ci\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}