nonebot-plugin-remove-bg


Namenonebot-plugin-remove-bg JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/Ikaros-521/nonebot_plugin_remove_bg
Summary适用于nonebot2 v11的基于trace.moe的动画截图场景追溯插件
upload_time2022-12-16 02:25:56
maintainer
docs_urlNone
authorIkaros
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <a href="https://v2.nonebot.dev/store"><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo"></a>
  <br>
  <p><img src="https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg" width="240" alt="NoneBotPluginText"></p>
</div>

<div align="center">

# nonebot_plugin_remove_bg
  
_✨ NoneBot 基于remove.bg的图片背景消除插件 ✨_
  
<a href="https://github.com/Ikaros-521/nonebot_plugin_remove_bg/stargazers">
    <img alt="GitHub stars" src="https://img.shields.io/github/stars/Ikaros-521/nonebot_plugin_remove_bg?color=%09%2300BFFF&style=flat-square">
</a>
<a href="https://github.com/Ikaros-521/nonebot_plugin_remove_bg/issues">
    <img alt="GitHub issues" src="https://img.shields.io/github/issues/Ikaros-521/nonebot_plugin_remove_bg?color=Emerald%20green&style=flat-square">
</a>
<a href="https://github.com/Ikaros-521/nonebot_plugin_remove_bg/network">
    <img alt="GitHub forks" src="https://img.shields.io/github/forks/Ikaros-521/nonebot_plugin_remove_bg?color=%2300BFFF&style=flat-square">
</a>
<a href="./LICENSE">
    <img src="https://img.shields.io/github/license/Ikaros-521/nonebot_plugin_remove_bg.svg" alt="license">
</a>
<a href="https://pypi.python.org/pypi/nonebot_plugin_remove_bg">
    <img src="https://img.shields.io/pypi/v/nonebot_plugin_remove_bg.svg" alt="pypi">
</a>
<a href="https://www.python.org">
    <img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
</a>

</div>

适用于nonebot2 v11的基于remove.bg的图片背景消除插件  
调用的相关API源自:[https://www.remove.bg/api#api-reference](https://www.remove.bg/api#api-reference)   

## 🔧 开发环境
Nonebot2:2.0.0b5  
python:3.8.13  
操作系统:Windows10(Linux兼容性问题不大)  
编辑器:pycharm  

## 💿 安装
环境依赖`aiohttp`库   

### 1. nb-cli安装(推荐)
在你bot工程的文件夹下,运行cmd(运行路径要对啊),执行nb命令安装插件,插件配置会自动添加至配置文件  
```
nb plugin install nonebot_plugin_remove_bg
```

### 2. 本地安装
先安装下 `aiohttp`  
```
pip install aiohttp
```
将项目clone到你的机器人插件下的对应插件目录内(一般为机器人文件夹下的`src/plugins`),然后把`nonebot_plugin_remove_bg`文件夹里的内容拷贝至上一级目录即可。  
clone命令参考(得先装`git`,懂的都懂):
```
git clone https://github.com/Ikaros-521/nonebot_plugin_remove_bg.git
``` 
也可以直接下载压缩包到插件目录解压,然后同样提取`nonebot_plugin_remove_bg`至上一级目录。  
目录结构: ```你的bot/src/plugins/nonebot_plugin_remove_bg/__init__.py```  


### 3. pip安装
```
pip install nonebot_plugin_remove_bg
```  
打开 nonebot2 项目的 ```bot.py``` 文件, 在其中写入  
```nonebot.load_plugin('nonebot_plugin_remove_bg')```  
当然,如果是默认nb-cli创建的nonebot2的话,在bot路径```pyproject.toml```的```[tool.nonebot]```的```plugins```中添加```nonebot_plugin_remove_bg```即可  
pyproject.toml配置例如:  
``` 
[tool.nonebot]
plugin_dirs = ["src/plugins"]
plugins = ["nonebot_plugin_remove_bg"]
``` 

### 更新版本
```
nb plugin update nonebot_plugin_remove_bg
```

## 🔧 配置  

### env配置
```
# nonebot_plugin_remove_bg 官方API KEY
REMOVE_BG_API_KEY="XXXXXXXXXXXXXXXXXXXXXXXX"
```
|       配置项        | 必填 | 默认值  |                      说明                      |
|:----------------:|:----:|:----:|:----------------------------:|
| `REMOVE_BG_API_KEY` | 是 | `` | 注册官方账号申请API KEY(每月50次免费额度) |

### API KEY获取方式
访问[https://www.remove.bg/api#remove-background](https://www.remove.bg/api#remove-background),注册账号,然后点击`Get API Key` -> ` New API Key` -> `Create API Key`。  

## 🎉 功能
基于remove.bg,上传图片调用API消除背景后返回处理后的图片  

## 👉 命令

### ①默认配置的背景消除

#### 1、先发送命令,再发送图片(命令前缀请自行替换)
先发送`/去背景`或`/rm_bg`,等bot返回`请发送需要去除背景的图片喵~`后,发送需要去除背景的图片即可。  

#### 2、命令+图片
编辑消息`/去背景[待去除背景的图片]`或`/rm_bg[待去除背景的图片]`发送即可。  
bot返回内容:  
![](docs/result.png)  

#### 3、回复图片+命令
回复需要处理的图片,然后追加命令`/去背景`或`/rm_bg`发送即可。

### ②自定义配置的背景消除

#### 1、命令+图片
命令如下(命令前缀自行添加):  
```
自定义去背景 -img <IMAGE> [-s --size -最大输出分辨率 <最大输出图像分辨率 'preview/full/auto'>] [-t --type -前景类型 <前景类型 'auto/person/product/car'>] [-tl --type_level -前景类型级别 <检测到的前景类型的分类级别 'none/1/2/latest'>]\n [-r --roi -感兴趣区域 <感兴趣区域 x1 y1 x2 y2,如'0% 0% 100% 100%'>] [-c --crop -裁剪空白区 <是否裁剪掉所有空白区域 'true/false'>] [-p --position -定位主题 <在图像画布中定位主题 'center/original/从“0%”到“100%”的一个值(水平和垂直)或两个值(水平、垂直)'>]\n [-sc --scale -缩放主体 <相对于图像总尺寸缩放主体 从“10%”到“100%”之间的任何值,也可以是“original”(默认)。缩放主体意味着“位置=中心”(除非另有说明)。>] [-ad --add_shadow -人工阴影 <是否向结果添加人工阴影 'true/false'>] [-se --semitransparency -半透明区域 <结果中是否包含半透明区域 'true/false'>]
``` 
命令起始:`自定义去背景` 或 `remove_bg`  
`-img` 必选参数,后面追加`<IMAGE>`图片(回复的话,图片就不用了)  
`-s` 可选参数 `-s`可以改成 `--size` 或 `-最大输出分辨率`,含义是最大输出图像分辨率,传参内容是`'preview/full/auto'`(3选1)  
其他的[]都是可选参数,含义和-s相同,不再赘述。  

例如:  
```
/自定义去背景 -img <IMAGE> -s 'preview'
/remove_bg -img <IMAGE> -s 'full' -r '30% 30% 60% 60%' -ad 'true'
/自定义去背景 -图片 <IMAGE> -最大输出分辨率 'preview' -前景类型 'person' -前景类型级别 '1' -感兴趣区域 '0% 0% 100% 100%' -裁剪空白区 'true' -定位主题 'center' -缩放主体 '50%' -人工阴影 'false'  -半透明区域 'false'
```

#### 2、回复图片+命令
命令与上面相同,注意必选参数`-img`,不要忘记了。  

#### 3、自定义去背景帮助
获取命令的帮助说明命令为`自定义去背景帮助` 或 `自定义去背景help`   
例如:  
```
/自定义去背景帮助
/自定义去背景help
```

## ⚙ 拓展
修改`__init__.py`中的`catch_str`等来自定义命令触发关键词。  
代码实现缝合怪,感觉很kuso,待优化(大坑)    

## 📝 更新日志

<details>
<summary>展开/收起</summary>

### 0.0.1

- 插件初次发布

### 0.0.2

- 向上兼容rc2  

### 0.1.0

- 修改原 remove_bg命令至 自定义去背景 功能(采用shell cmd的形式)。
- 原 rm_bg 和 去背景 命令,增加可以直接回复图片进行处理。

### 0.1.1

- 修复 私聊bot无法正常运行的bug

### 0.1.2

- 插件补充元信息

</details>

## 致谢

- [remove.bg](https://www.remove.bg) - API来源  

## 项目打包上传至pypi

官网:https://pypi.org,注册账号,在系统用户根目录下创建`.pypirc`,配置  
``` 
[distutils] 
index-servers=pypi 
 
[pypi] repository = https://upload.pypi.org/legacy/ 
username = 用户名 
password = 密码
```

### poetry

```
# 参考 https://www.freesion.com/article/58051228882/
# poetry config pypi-token.pypi

# 1、安装poetry
pip install poetry

# 2、初始化配置文件(根据提示填写)
poetry init

# 3、微调配置文件pyproject.toml

# 4、运行 poetry install, 可生成 “poetry.lock” 文件(可跳过)
poetry install

# 5、编译,生成dist
poetry build

# 6、发布(poetry config pypi-token.pypi 配置token)
poetry publish

```

### twine

```
# 参考 https://www.cnblogs.com/danhuai/p/14915042.html
#创建setup.py文件 填写相关信息

# 1、可以先升级打包工具
pip install --upgrade setuptools wheel twine

# 2、打包
python setup.py sdist bdist_wheel

# 3、可以先检查一下包
twine check dist/*

# 4、上传包到pypi(需输入用户名、密码)
twine upload dist/*
```
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Ikaros-521/nonebot_plugin_remove_bg",
    "name": "nonebot-plugin-remove-bg",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Ikaros",
    "author_email": "327209194@qq.com",
    "download_url": "https://files.pythonhosted.org/packages/ac/5f/ec7f04b3fb3aac4eb4df5011fbb7126ea5a8d9483c9462b1536ca8054c1f/nonebot_plugin_remove_bg-0.1.2.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <a href=\"https://v2.nonebot.dev/store\"><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/nbp_logo.png\" width=\"180\" height=\"180\" alt=\"NoneBotPluginLogo\"></a>\n  <br>\n  <p><img src=\"https://github.com/A-kirami/nonebot-plugin-template/blob/resources/NoneBotPlugin.svg\" width=\"240\" alt=\"NoneBotPluginText\"></p>\n</div>\n\n<div align=\"center\">\n\n# nonebot_plugin_remove_bg\n  \n_\u2728 NoneBot \u57fa\u4e8eremove.bg\u7684\u56fe\u7247\u80cc\u666f\u6d88\u9664\u63d2\u4ef6 \u2728_\n  \n<a href=\"https://github.com/Ikaros-521/nonebot_plugin_remove_bg/stargazers\">\n    <img alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/Ikaros-521/nonebot_plugin_remove_bg?color=%09%2300BFFF&style=flat-square\">\n</a>\n<a href=\"https://github.com/Ikaros-521/nonebot_plugin_remove_bg/issues\">\n    <img alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/Ikaros-521/nonebot_plugin_remove_bg?color=Emerald%20green&style=flat-square\">\n</a>\n<a href=\"https://github.com/Ikaros-521/nonebot_plugin_remove_bg/network\">\n    <img alt=\"GitHub forks\" src=\"https://img.shields.io/github/forks/Ikaros-521/nonebot_plugin_remove_bg?color=%2300BFFF&style=flat-square\">\n</a>\n<a href=\"./LICENSE\">\n    <img src=\"https://img.shields.io/github/license/Ikaros-521/nonebot_plugin_remove_bg.svg\" alt=\"license\">\n</a>\n<a href=\"https://pypi.python.org/pypi/nonebot_plugin_remove_bg\">\n    <img src=\"https://img.shields.io/pypi/v/nonebot_plugin_remove_bg.svg\" alt=\"pypi\">\n</a>\n<a href=\"https://www.python.org\">\n    <img src=\"https://img.shields.io/badge/python-3.8+-blue.svg\" alt=\"python\">\n</a>\n\n</div>\n\n\u9002\u7528\u4e8enonebot2 v11\u7684\u57fa\u4e8eremove.bg\u7684\u56fe\u7247\u80cc\u666f\u6d88\u9664\u63d2\u4ef6  \n\u8c03\u7528\u7684\u76f8\u5173API\u6e90\u81ea:[https://www.remove.bg/api#api-reference](https://www.remove.bg/api#api-reference)   \n\n## \ud83d\udd27 \u5f00\u53d1\u73af\u5883\nNonebot2\uff1a2.0.0b5  \npython\uff1a3.8.13  \n\u64cd\u4f5c\u7cfb\u7edf\uff1aWindows10\uff08Linux\u517c\u5bb9\u6027\u95ee\u9898\u4e0d\u5927\uff09  \n\u7f16\u8f91\u5668\uff1apycharm  \n\n## \ud83d\udcbf \u5b89\u88c5\n\u73af\u5883\u4f9d\u8d56`aiohttp`\u5e93   \n\n### 1. nb-cli\u5b89\u88c5\uff08\u63a8\u8350\uff09\n\u5728\u4f60bot\u5de5\u7a0b\u7684\u6587\u4ef6\u5939\u4e0b\uff0c\u8fd0\u884ccmd\uff08\u8fd0\u884c\u8def\u5f84\u8981\u5bf9\u554a\uff09\uff0c\u6267\u884cnb\u547d\u4ee4\u5b89\u88c5\u63d2\u4ef6\uff0c\u63d2\u4ef6\u914d\u7f6e\u4f1a\u81ea\u52a8\u6dfb\u52a0\u81f3\u914d\u7f6e\u6587\u4ef6  \n```\nnb plugin install nonebot_plugin_remove_bg\n```\n\n### 2. \u672c\u5730\u5b89\u88c5\n\u5148\u5b89\u88c5\u4e0b `aiohttp`  \n```\npip install aiohttp\n```\n\u5c06\u9879\u76eeclone\u5230\u4f60\u7684\u673a\u5668\u4eba\u63d2\u4ef6\u4e0b\u7684\u5bf9\u5e94\u63d2\u4ef6\u76ee\u5f55\u5185\uff08\u4e00\u822c\u4e3a\u673a\u5668\u4eba\u6587\u4ef6\u5939\u4e0b\u7684`src/plugins`\uff09\uff0c\u7136\u540e\u628a`nonebot_plugin_remove_bg`\u6587\u4ef6\u5939\u91cc\u7684\u5185\u5bb9\u62f7\u8d1d\u81f3\u4e0a\u4e00\u7ea7\u76ee\u5f55\u5373\u53ef\u3002  \nclone\u547d\u4ee4\u53c2\u8003\uff08\u5f97\u5148\u88c5`git`\uff0c\u61c2\u7684\u90fd\u61c2\uff09\uff1a\n```\ngit clone https://github.com/Ikaros-521/nonebot_plugin_remove_bg.git\n``` \n\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4e0b\u8f7d\u538b\u7f29\u5305\u5230\u63d2\u4ef6\u76ee\u5f55\u89e3\u538b\uff0c\u7136\u540e\u540c\u6837\u63d0\u53d6`nonebot_plugin_remove_bg`\u81f3\u4e0a\u4e00\u7ea7\u76ee\u5f55\u3002  \n\u76ee\u5f55\u7ed3\u6784\uff1a ```\u4f60\u7684bot/src/plugins/nonebot_plugin_remove_bg/__init__.py```  \n\n\n### 3. pip\u5b89\u88c5\n```\npip install nonebot_plugin_remove_bg\n```  \n\u6253\u5f00 nonebot2 \u9879\u76ee\u7684 ```bot.py``` \u6587\u4ef6, \u5728\u5176\u4e2d\u5199\u5165  \n```nonebot.load_plugin('nonebot_plugin_remove_bg')```  \n\u5f53\u7136\uff0c\u5982\u679c\u662f\u9ed8\u8ba4nb-cli\u521b\u5efa\u7684nonebot2\u7684\u8bdd\uff0c\u5728bot\u8def\u5f84```pyproject.toml```\u7684```[tool.nonebot]```\u7684```plugins```\u4e2d\u6dfb\u52a0```nonebot_plugin_remove_bg```\u5373\u53ef  \npyproject.toml\u914d\u7f6e\u4f8b\u5982\uff1a  \n``` \n[tool.nonebot]\nplugin_dirs = [\"src/plugins\"]\nplugins = [\"nonebot_plugin_remove_bg\"]\n``` \n\n### \u66f4\u65b0\u7248\u672c\n```\nnb plugin update nonebot_plugin_remove_bg\n```\n\n## \ud83d\udd27 \u914d\u7f6e  \n\n### env\u914d\u7f6e\n```\n# nonebot_plugin_remove_bg \u5b98\u65b9API KEY\nREMOVE_BG_API_KEY=\"XXXXXXXXXXXXXXXXXXXXXXXX\"\n```\n|       \u914d\u7f6e\u9879        | \u5fc5\u586b | \u9ed8\u8ba4\u503c  |                      \u8bf4\u660e                      |\n|:----------------:|:----:|:----:|:----------------------------:|\n| `REMOVE_BG_API_KEY` | \u662f | `` | \u6ce8\u518c\u5b98\u65b9\u8d26\u53f7\u7533\u8bf7API KEY\uff08\u6bcf\u670850\u6b21\u514d\u8d39\u989d\u5ea6\uff09 |\n\n### API KEY\u83b7\u53d6\u65b9\u5f0f\n\u8bbf\u95ee[https://www.remove.bg/api#remove-background](https://www.remove.bg/api#remove-background)\uff0c\u6ce8\u518c\u8d26\u53f7\uff0c\u7136\u540e\u70b9\u51fb`Get API Key` -> ` New API Key` -> `Create API Key`\u3002  \n\n## \ud83c\udf89 \u529f\u80fd\n\u57fa\u4e8eremove.bg\uff0c\u4e0a\u4f20\u56fe\u7247\u8c03\u7528API\u6d88\u9664\u80cc\u666f\u540e\u8fd4\u56de\u5904\u7406\u540e\u7684\u56fe\u7247  \n\n## \ud83d\udc49 \u547d\u4ee4\n\n### \u2460\u9ed8\u8ba4\u914d\u7f6e\u7684\u80cc\u666f\u6d88\u9664\n\n#### 1\u3001\u5148\u53d1\u9001\u547d\u4ee4\uff0c\u518d\u53d1\u9001\u56fe\u7247\uff08\u547d\u4ee4\u524d\u7f00\u8bf7\u81ea\u884c\u66ff\u6362\uff09\n\u5148\u53d1\u9001`/\u53bb\u80cc\u666f`\u6216`/rm_bg`\uff0c\u7b49bot\u8fd4\u56de`\u8bf7\u53d1\u9001\u9700\u8981\u53bb\u9664\u80cc\u666f\u7684\u56fe\u7247\u55b5~`\u540e\uff0c\u53d1\u9001\u9700\u8981\u53bb\u9664\u80cc\u666f\u7684\u56fe\u7247\u5373\u53ef\u3002  \n\n#### 2\u3001\u547d\u4ee4+\u56fe\u7247\n\u7f16\u8f91\u6d88\u606f`/\u53bb\u80cc\u666f[\u5f85\u53bb\u9664\u80cc\u666f\u7684\u56fe\u7247]`\u6216`/rm_bg[\u5f85\u53bb\u9664\u80cc\u666f\u7684\u56fe\u7247]`\u53d1\u9001\u5373\u53ef\u3002  \nbot\u8fd4\u56de\u5185\u5bb9\uff1a  \n![](docs/result.png)  \n\n#### 3\u3001\u56de\u590d\u56fe\u7247+\u547d\u4ee4\n\u56de\u590d\u9700\u8981\u5904\u7406\u7684\u56fe\u7247\uff0c\u7136\u540e\u8ffd\u52a0\u547d\u4ee4`/\u53bb\u80cc\u666f`\u6216`/rm_bg`\u53d1\u9001\u5373\u53ef\u3002\n\n### \u2461\u81ea\u5b9a\u4e49\u914d\u7f6e\u7684\u80cc\u666f\u6d88\u9664\n\n#### 1\u3001\u547d\u4ee4+\u56fe\u7247\n\u547d\u4ee4\u5982\u4e0b(\u547d\u4ee4\u524d\u7f00\u81ea\u884c\u6dfb\u52a0)\uff1a  \n```\n\u81ea\u5b9a\u4e49\u53bb\u80cc\u666f -img <IMAGE> [-s --size -\u6700\u5927\u8f93\u51fa\u5206\u8fa8\u7387 <\u6700\u5927\u8f93\u51fa\u56fe\u50cf\u5206\u8fa8\u7387 'preview/full/auto'>] [-t --type -\u524d\u666f\u7c7b\u578b <\u524d\u666f\u7c7b\u578b 'auto/person/product/car'>] [-tl --type_level -\u524d\u666f\u7c7b\u578b\u7ea7\u522b <\u68c0\u6d4b\u5230\u7684\u524d\u666f\u7c7b\u578b\u7684\u5206\u7c7b\u7ea7\u522b 'none/1/2/latest'>]\\n [-r --roi -\u611f\u5174\u8da3\u533a\u57df <\u611f\u5174\u8da3\u533a\u57df x1 y1 x2 y2\uff0c\u5982'0% 0% 100% 100%'>] [-c --crop -\u88c1\u526a\u7a7a\u767d\u533a <\u662f\u5426\u88c1\u526a\u6389\u6240\u6709\u7a7a\u767d\u533a\u57df 'true/false'>] [-p --position -\u5b9a\u4f4d\u4e3b\u9898 <\u5728\u56fe\u50cf\u753b\u5e03\u4e2d\u5b9a\u4f4d\u4e3b\u9898 'center/original/\u4ece\u201c0%\u201d\u5230\u201c100%\u201d\u7684\u4e00\u4e2a\u503c(\u6c34\u5e73\u548c\u5782\u76f4)\u6216\u4e24\u4e2a\u503c(\u6c34\u5e73\u3001\u5782\u76f4)'>]\\n [-sc --scale -\u7f29\u653e\u4e3b\u4f53 <\u76f8\u5bf9\u4e8e\u56fe\u50cf\u603b\u5c3a\u5bf8\u7f29\u653e\u4e3b\u4f53 \u4ece\u201c10%\u201d\u5230\u201c100%\u201d\u4e4b\u95f4\u7684\u4efb\u4f55\u503c\uff0c\u4e5f\u53ef\u4ee5\u662f\u201coriginal\u201d(\u9ed8\u8ba4)\u3002\u7f29\u653e\u4e3b\u4f53\u610f\u5473\u7740\u201c\u4f4d\u7f6e=\u4e2d\u5fc3\u201d(\u9664\u975e\u53e6\u6709\u8bf4\u660e)\u3002>] [-ad --add_shadow -\u4eba\u5de5\u9634\u5f71 <\u662f\u5426\u5411\u7ed3\u679c\u6dfb\u52a0\u4eba\u5de5\u9634\u5f71 'true/false'>] [-se --semitransparency -\u534a\u900f\u660e\u533a\u57df <\u7ed3\u679c\u4e2d\u662f\u5426\u5305\u542b\u534a\u900f\u660e\u533a\u57df 'true/false'>]\n``` \n\u547d\u4ee4\u8d77\u59cb\uff1a`\u81ea\u5b9a\u4e49\u53bb\u80cc\u666f` \u6216 `remove_bg`  \n`-img` \u5fc5\u9009\u53c2\u6570\uff0c\u540e\u9762\u8ffd\u52a0`<IMAGE>`\u56fe\u7247\uff08\u56de\u590d\u7684\u8bdd\uff0c\u56fe\u7247\u5c31\u4e0d\u7528\u4e86\uff09  \n`-s` \u53ef\u9009\u53c2\u6570 `-s`\u53ef\u4ee5\u6539\u6210 `--size` \u6216 `-\u6700\u5927\u8f93\u51fa\u5206\u8fa8\u7387`\uff0c\u542b\u4e49\u662f\u6700\u5927\u8f93\u51fa\u56fe\u50cf\u5206\u8fa8\u7387\uff0c\u4f20\u53c2\u5185\u5bb9\u662f`'preview/full/auto'`\uff083\u90091\uff09  \n\u5176\u4ed6\u7684[]\u90fd\u662f\u53ef\u9009\u53c2\u6570\uff0c\u542b\u4e49\u548c-s\u76f8\u540c\uff0c\u4e0d\u518d\u8d58\u8ff0\u3002  \n\n\u4f8b\u5982\uff1a  \n```\n/\u81ea\u5b9a\u4e49\u53bb\u80cc\u666f -img <IMAGE> -s 'preview'\n/remove_bg -img <IMAGE> -s 'full' -r '30% 30% 60% 60%' -ad 'true'\n/\u81ea\u5b9a\u4e49\u53bb\u80cc\u666f -\u56fe\u7247 <IMAGE> -\u6700\u5927\u8f93\u51fa\u5206\u8fa8\u7387 'preview' -\u524d\u666f\u7c7b\u578b 'person' -\u524d\u666f\u7c7b\u578b\u7ea7\u522b '1' -\u611f\u5174\u8da3\u533a\u57df '0% 0% 100% 100%' -\u88c1\u526a\u7a7a\u767d\u533a 'true' -\u5b9a\u4f4d\u4e3b\u9898 'center' -\u7f29\u653e\u4e3b\u4f53 '50%' -\u4eba\u5de5\u9634\u5f71 'false'  -\u534a\u900f\u660e\u533a\u57df 'false'\n```\n\n#### 2\u3001\u56de\u590d\u56fe\u7247+\u547d\u4ee4\n\u547d\u4ee4\u4e0e\u4e0a\u9762\u76f8\u540c\uff0c\u6ce8\u610f\u5fc5\u9009\u53c2\u6570`-img`\uff0c\u4e0d\u8981\u5fd8\u8bb0\u4e86\u3002  \n\n#### 3\u3001\u81ea\u5b9a\u4e49\u53bb\u80cc\u666f\u5e2e\u52a9\n\u83b7\u53d6\u547d\u4ee4\u7684\u5e2e\u52a9\u8bf4\u660e\u547d\u4ee4\u4e3a`\u81ea\u5b9a\u4e49\u53bb\u80cc\u666f\u5e2e\u52a9` \u6216 `\u81ea\u5b9a\u4e49\u53bb\u80cc\u666fhelp`   \n\u4f8b\u5982\uff1a  \n```\n/\u81ea\u5b9a\u4e49\u53bb\u80cc\u666f\u5e2e\u52a9\n/\u81ea\u5b9a\u4e49\u53bb\u80cc\u666fhelp\n```\n\n## \u2699 \u62d3\u5c55\n\u4fee\u6539`__init__.py`\u4e2d\u7684`catch_str`\u7b49\u6765\u81ea\u5b9a\u4e49\u547d\u4ee4\u89e6\u53d1\u5173\u952e\u8bcd\u3002  \n\u4ee3\u7801\u5b9e\u73b0\u7f1d\u5408\u602a\uff0c\u611f\u89c9\u5f88kuso\uff0c\u5f85\u4f18\u5316\uff08\u5927\u5751\uff09    \n\n## \ud83d\udcdd \u66f4\u65b0\u65e5\u5fd7\n\n<details>\n<summary>\u5c55\u5f00/\u6536\u8d77</summary>\n\n### 0.0.1\n\n- \u63d2\u4ef6\u521d\u6b21\u53d1\u5e03\n\n### 0.0.2\n\n- \u5411\u4e0a\u517c\u5bb9rc2  \n\n### 0.1.0\n\n- \u4fee\u6539\u539f remove_bg\u547d\u4ee4\u81f3 \u81ea\u5b9a\u4e49\u53bb\u80cc\u666f \u529f\u80fd\uff08\u91c7\u7528shell cmd\u7684\u5f62\u5f0f\uff09\u3002\n- \u539f rm_bg \u548c \u53bb\u80cc\u666f \u547d\u4ee4\uff0c\u589e\u52a0\u53ef\u4ee5\u76f4\u63a5\u56de\u590d\u56fe\u7247\u8fdb\u884c\u5904\u7406\u3002\n\n### 0.1.1\n\n- \u4fee\u590d \u79c1\u804abot\u65e0\u6cd5\u6b63\u5e38\u8fd0\u884c\u7684bug\n\n### 0.1.2\n\n- \u63d2\u4ef6\u8865\u5145\u5143\u4fe1\u606f\n\n</details>\n\n## \u81f4\u8c22\n\n- [remove.bg](https://www.remove.bg) - API\u6765\u6e90  \n\n## \u9879\u76ee\u6253\u5305\u4e0a\u4f20\u81f3pypi\n\n\u5b98\u7f51\uff1ahttps://pypi.org\uff0c\u6ce8\u518c\u8d26\u53f7\uff0c\u5728\u7cfb\u7edf\u7528\u6237\u6839\u76ee\u5f55\u4e0b\u521b\u5efa`.pypirc`\uff0c\u914d\u7f6e  \n``` \n[distutils] \nindex-servers=pypi \n \n[pypi] repository = https://upload.pypi.org/legacy/ \nusername = \u7528\u6237\u540d \npassword = \u5bc6\u7801\n```\n\n### poetry\n\n```\n# \u53c2\u8003 https://www.freesion.com/article/58051228882/\n# poetry config pypi-token.pypi\n\n# 1\u3001\u5b89\u88c5poetry\npip install poetry\n\n# 2\u3001\u521d\u59cb\u5316\u914d\u7f6e\u6587\u4ef6\uff08\u6839\u636e\u63d0\u793a\u586b\u5199\uff09\npoetry init\n\n# 3\u3001\u5fae\u8c03\u914d\u7f6e\u6587\u4ef6pyproject.toml\n\n# 4\u3001\u8fd0\u884c poetry install, \u53ef\u751f\u6210 \u201cpoetry.lock\u201d \u6587\u4ef6\uff08\u53ef\u8df3\u8fc7\uff09\npoetry install\n\n# 5\u3001\u7f16\u8bd1\uff0c\u751f\u6210dist\npoetry build\n\n# 6\u3001\u53d1\u5e03(poetry config pypi-token.pypi \u914d\u7f6etoken)\npoetry publish\n\n```\n\n### twine\n\n```\n# \u53c2\u8003 https://www.cnblogs.com/danhuai/p/14915042.html\n#\u521b\u5efasetup.py\u6587\u4ef6 \u586b\u5199\u76f8\u5173\u4fe1\u606f\n\n# 1\u3001\u53ef\u4ee5\u5148\u5347\u7ea7\u6253\u5305\u5de5\u5177\npip install --upgrade setuptools wheel twine\n\n# 2\u3001\u6253\u5305\npython setup.py sdist bdist_wheel\n\n# 3\u3001\u53ef\u4ee5\u5148\u68c0\u67e5\u4e00\u4e0b\u5305\ntwine check dist/*\n\n# 4\u3001\u4e0a\u4f20\u5305\u5230pypi\uff08\u9700\u8f93\u5165\u7528\u6237\u540d\u3001\u5bc6\u7801\uff09\ntwine upload dist/*\n```",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\u9002\u7528\u4e8enonebot2 v11\u7684\u57fa\u4e8etrace.moe\u7684\u52a8\u753b\u622a\u56fe\u573a\u666f\u8ffd\u6eaf\u63d2\u4ef6",
    "version": "0.1.2",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "d7a4334f62056ff581f008496036a4e3",
                "sha256": "7238109cc973fcebe0803ff8ca7a12b756e1088a6b369b18ea8479051458ed79"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_remove_bg-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d7a4334f62056ff581f008496036a4e3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 9709,
            "upload_time": "2022-12-16T02:25:54",
            "upload_time_iso_8601": "2022-12-16T02:25:54.321114Z",
            "url": "https://files.pythonhosted.org/packages/ab/f0/27bebe6474ea5b232bca164417dc6850f4de8e94c88ef966278f79d76129/nonebot_plugin_remove_bg-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "5a9741d607c7b49946f518514d6a0aaf",
                "sha256": "e1c3a8fdd8f06185fe2c6d602362609b91d2c3b9a68ee3fa68e9fb8998f4bb66"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_remove_bg-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "5a9741d607c7b49946f518514d6a0aaf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 9947,
            "upload_time": "2022-12-16T02:25:56",
            "upload_time_iso_8601": "2022-12-16T02:25:56.446149Z",
            "url": "https://files.pythonhosted.org/packages/ac/5f/ec7f04b3fb3aac4eb4df5011fbb7126ea5a8d9483c9462b1536ca8054c1f/nonebot_plugin_remove_bg-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-16 02:25:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Ikaros-521",
    "github_project": "nonebot_plugin_remove_bg",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nonebot-plugin-remove-bg"
}
        
Elapsed time: 0.02166s