Skip to content

Commit ca80c97

Browse files
committed
Revert "update readme"
This reverts commit eba41898911ff9a36195d0e074307a6b161008f8.
1 parent 8cf7dc6 commit ca80c97

File tree

1 file changed

+57
-63
lines changed

1 file changed

+57
-63
lines changed

README.md

Lines changed: 57 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
# tencentyun-youtu-java
1+
# tencentyun-youtu-python
22

3-
java sdk for [腾讯云智能优图服务](http://www.qcloud.com/product/fr.html) & [腾讯优图开放平台](http://open.youtu.qq.com)
3+
python sdk for [腾讯云智能优图服务](http://www.qcloud.com/product/fr.html) & [腾讯优图开放平台](http://open.youtu.qq.com)
44

55
## 安装
66

7+
####依赖项
8+
```
9+
- Requests,获取更新版本
10+
http://docs.python-requests.org/en/latest/
11+
```
712
####构建工程
813
```
9-
1. 下载sdk到您的目录
10-
git clone https://github.com/TencentYouTu/java_sdk.git
11-
2. 在你的项目里引入本项目dist目录下的json.jar和youtu-java-sdk.jar包或者直接引入源码.
12-
3. 导入包并创建Youtu对象,然后调用相应方法.
14+
1. 下载sdk到您的目录${python_sdk}
15+
git clone https://github.com/TencentYouTu/python_sdk.git
16+
2. 在您需要使用sdk的文件中import TencentYoutuyun包
1317
```
1418

1519
## 名词
@@ -22,141 +26,131 @@ java sdk for [腾讯云智能优图服务](http://www.qcloud.com/product/fr.html
2226

2327
## 使用示例
2428
```
25-
import org.json.JSONObject;
26-
import com.youtu.*;
27-
// 请把下面的APP_ID、SECRET_ID和SECRET_KEY换成你自己的数据,下面的数据已经不可用
28-
public static final String APP_ID = "1000234";
29-
public static final String SECRET_ID = "AKIDUIsdfDlPDt5mZutfr46sdNT0GisFcQh1nMOox";
30-
public static final String SECRET_KEY = "ind5yAd55ZspBc7MCANcxsdEjuXi8YU8RL";
31-
32-
Youtu faceYoutu = new Youtu(APP_ID, SECRET_ID, SECRET_KEY);
33-
JSONObject respose = faceYoutu.DetectFace("test.jpg");
34-
//get respose
35-
System.out.println(respose);
36-
//get detail info
37-
if(respose.getInt("errorcode")==0){
38-
System.out.println(respose.get("image_height"));
39-
System.out.println(respose.get("face"));
40-
System.out.println(respose.getJSONArray("face").getJSONObject(0).get("yaw"));
41-
System.out.println(respose.getInt("errorcode"));
42-
System.out.println(respose.get("errormsg"));
43-
}
29+
# -*- coding: utf-8 -*-
30+
31+
import time
32+
import TencentYoutuyun
33+
34+
appid = '105054'
35+
secret_id = 'J9I1LNj5Wdr8TxI2VyWai3Ziz5TiZ2vZsp'
36+
secret_key = 'J9I1LNjWdr8TxI2VyWai3ZizTiZ2vZsp'
37+
38+
youtu = TencentYoutuyun.YouTu(appid, secret_id, secret_key)
39+
40+
ret = youtu.FaceCompare('you_path_one.jpg','you_path_two.jpg')
41+
print ret
4442
```
4543

4644
##初始化
4745
- 示例
48-
- `Youtu faceYoutu = new Youtu(appid, secret_id, secret_key);`
46+
- `youtu = TencentYoutuyun.YouTu(appid, secret_id, secret_key)`
4947

50-
- 参数
48+
- 参数`ytopen_sdk::AppSign`
5149
- `appid` 业务中的应用标识AppId
5250
- `secret_id` 秘钥SecretId
5351
- `secret_key` 秘钥SecretKey
5452

5553
##接口说明
5654
接口调用统一返回值说明
57-
- 返回值 `JSONObject`
55+
- 返回值
5856
`Json`格式的返回结果,具体字段参考API文档
59-
57+
6058
###人脸检测
6159
- 接口
62-
`JSONObject DetectFace(String image_path,int mode)`
63-
- 参数
64-
- `image_path` 待检测的图片路径
65-
- `mode` 是否大脸模式,默认非大脸模式
66-
67-
###人脸配准
68-
- 接口
69-
`JSONObject FaceShape(String image_path,int mode)`
60+
`DetectFace(self, image, mode = 0)`
7061
- 参数
71-
- `image_path` 待检测的图片路径
62+
- `image` 待检测的图片路径
7263
- `mode` 是否大脸模式,默认非大脸模式
7364

7465
###人脸比对
7566
- 接口
76-
`JSONObject FaceCompare(String image_path_a, String image_path_b)`
67+
`FaceCompare(self, imageA, imageB):`
7768
- 参数
78-
- `image_path_a` 待比对的A图片数据,base64编码
79-
- `image_path_b` 待比对的B图片数据,base64编码
69+
- `imageA` 待比对的A图片路径
70+
- `imageB` 待比对的B图片路径
8071

8172
###人脸验证
8273
- 接口
83-
`JSONObject FaceVerify(String image_path, String person_id)`
74+
`FaceVerify(self, person_id, image)`
8475
- 参数
8576
- `person_id` 待验证的人脸id
86-
- `image_path` 待验证的图片数据路径
77+
- `image` 待验证的图片路径
8778

8879
###人脸识别
8980
- 接口
90-
`JSONObject FaceIdentify(String image_path, String group_id)`
81+
`FaceIdentify(self, group_id, image)`
9182
- 参数
92-
- `group_id` 待识别的组id
93-
- `image_path` 待识别的图片数据路径
83+
- `group_id` 识别的组id
84+
- `image` 待识别的图片路径
9485

9586
###新建个体
9687
- 接口
97-
`JSONObject NewPerson(String image_path, String person_id, List<String> group_ids)`
88+
`NewPerson(self, person_id, image, group_ids, person_name= '', tag='')`
9889
- 参数
9990
- `person_id` 新建的个体id,用户指定,需要保证app_id下的唯一性
100-
- `person_name` 新建的个体名称
101-
- `group_ids` 新建的个体存放的组id,可以指定多个组id,用户指定(组默认创建)
102-
- `image_path` 包含个体人脸的图片路径
91+
- `person_name` 待验证的图片数据
92+
- `group_ids` 数组类型,用户指定(组默认创建)的个体存放的组id,可以指定多个组id
93+
- `image` 包含个体人脸的图片路径
10394
- `tag` 备注信息,用户自解释字段
10495

10596
###删除个体
10697
- 接口
107-
`JSONObject DelPerson(String person_id)`
98+
`DelPerson(self, person_id)`
10899
- 参数
109100
- `person_id` 待删除的个体id
110101

111102
###增加人脸
112103
- 接口
113-
`JSONObject AddFace(String person_id, List<String> image_path_arr)`
104+
`AddFace(self, person_id, images, tag='')`
114105
- 参数
115106
- `person_id` 新增人脸的个体身份id
116-
- `image_path_arr` 待增加的包含人脸的图片数据的路径,可加入多张(总包体大小<2m)
107+
- `images` 数组类型,待增加的包含人脸的图片路径,可加入多张(包体大小<2m)
108+
- `tag` 人脸备注信息,用户自解释字段
117109

118110
###删除人脸
119111
- 接口
120-
`JSONObject DelFace(String person_id, List<String> face_id_arr)`
112+
`DelFace(self, person_id, face_ids)`
121113
- 参数
122114
- `person_id` 待删除人脸的个体身份id
123-
- `face_id_arr` 待删除的人脸id集合
115+
- `face_ids` 数组类型,待删除的人脸id
124116

125117
###获取信息
126118
- 接口
127-
`JSONObject GetInfo(String person_id)`
119+
`GetInfo(self, person_id)`
128120
- 参数
129121
- `person_id` 待查询的个体身份id
130122

131123
###设置信息
132124
- 接口
133-
`JSONObject SetInfo(String person_name, String person_id)`
125+
`SetInfo(self, person_id, person_name='', tag='')`
134126
- 参数
135127
- `person_id` 待设置的个体身份id
136-
- `person_name` 新设置的个体名字
128+
- `person_name` 新设置的个体名字,为空无效
129+
- `tag` 新设置的人脸备注信息,为空无效
137130

138131
###获取组列表
139132
- 接口
140-
`JSONObject GetGroupIds()`
133+
`GetGroupIds(self)`
141134
- 参数
142135
- 无
136+
143137
###获取个体列表
144138
- 接口
145-
`JSONObject GetPersonIds(String group_id)`
139+
`GetPersonIds(self, group_id)`
146140
- 参数
147141
- `group_id` 待查询的组id
148142

149143
###获取人脸列表
150144
- 接口
151-
`JSONObject GetFaceIds(String person_id)`
145+
`GetFaceIds(self, person_id)`
152146
- 参数
153147
- `person_id` 待查询的个体id
154148

155149
###获取人脸信息
156150
- 接口
157-
`JSONObject GetFaceInfo(String face_id)`
151+
`GetFaceInfo(self, face_id)`
158152
- 参数
159-
- `face_id` 待查询人脸的id
153+
- `face_id` 待查询的人脸id
160154

161155
```
162156
```

0 commit comments

Comments
 (0)