Easy use of apis for Tencent AI
Project description
# qqai
提供[腾讯AI](https://ai.qq.com/)简单易用的python接口。
## 安装
```bash
pip install qqai
```
## 用法
当前包含以下接口:
- [聊天机器人](#聊天机器人)
- [图片转文字](#图片转文字)
- [人脸检测](#人脸检测)
### 聊天机器人
```py
from qqai import TextChat
siri = TextChat(your_app_id, your_app_key)
# 单句对话
answer = siri.ask('你是谁')
print(answer)
# >>> 我是你的小助手啊
# 连续聊天
siri.chat()
# < 有啥想跟我说的?
# > 你是谁啊?
# < 我是你的小助手啊
# > 你能干嘛呀
# < 呵呵,我能干的事情多的数不清。
```
### 图片转文字
```py
from qqai import ImgToText
robot = ImgToText(your_app_id, your_app_key)
# 识别图片URL
result = robot.run('https://yyb.gtimg.com/aiplat/ai/assets/ai-demo/express-6.jpg')
print(result)
# {'ret': 0, 'msg': 'ok', 'data': {'text': '一位男士在海边骑自行车的照片'}}
# 识别打开的本地图片
with open('/my/img.jpeg', 'rb') as image_file:
result = robot.run(image_file)
print(result)
# {'ret': 0, 'msg': 'ok', 'data': {'text': '一艘飞船'}}
```
### 人脸检测
```py
from qqai import Detectface
robot = Detectface(your_app_id, your_app_key)
# 调用方法与图片转文字相同
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qqai-0.1.1.tar.gz
(3.0 kB
view details)
Built Distribution
File details
Details for the file qqai-0.1.1.tar.gz
.
File metadata
- Download URL: qqai-0.1.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c5a2931a60250ad53b776f82337c67367b11dbcd304e75f0c90589811bccd8 |
|
MD5 | 733f3d3bc13b3ac0d88325e13280dd4f |
|
BLAKE2b-256 | 63fba04a4d216443e5a006f88f321e0b120bffc2a6ccc18f41fe9bee5d2a4058 |
File details
Details for the file qqai-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: qqai-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96a8ba79184dcf6d6d1a8d21890ef44c4b45f065c9e3d61691ea858a73740250 |
|
MD5 | 87cfc032557ea941a8d8ffd7d68af0e4 |
|
BLAKE2b-256 | a59dc1f48efdfb30240f4f1f24d3fb5dfb72fb34d12fe16c5478e74a6d62b855 |