DataLake SDK
Project description
回流服务SDK
怎么使用
- 初始化SDK
from datalakesdk import DataLakeSDK
client = DataLakeSDK()
- 同时上传文件和文件信息 在上传文件的同时上传文件信息
upload_data_with_info(raw_data: dict, file_path: str, directory: str)
参数
raw_data: dict 上传的文件对应的文件信息
file_path: str 本地文件路径(可以是视频或图片)
directory: str 上传到minio的目录前缀名,如果不知道这个是干啥的,留空就可以
返回值
{ raw_data_id: str }
使用示例
## 上传文件
upload_response = client.upload_data_with_info("test.jpeg", "test")
## 上传文件对应的信息
sourceType = "collect"
raw_data = {
"type": "image",
"region": "CN",
"bg": "Appliances",
"owner": "xxx.xx",
"sourceInfo":{"type": sourceType},
"meta": {}
}
client.upload_raw_data(raw_data)
- 上传文件标注 一个文件标注必须要对应一个文件 多个文件标注可以对应一个文件
upload_annotated_data(annotated_data: dict)
参数
annotated_data: dict 上传的文件对应的标注信息
返回值
{ annotation_data_id: str }
使用示例
## 上传文件对应的标注
labelInfo = [{"bbox_xyxy": [4307,1834,4462,1952],"label": "shoes","score": 0.3,"labelType": 0}]
annotation_data = {
"dataId": ["1b49483de4233df15fb5b92a05bebe8e"],
"annotationType": "detection",
"labelScope": ["shoes"],
"labelInfo": labelInfo,
"bg": "Appliances",
"owner": "ivan.liu",
"labelMethod": "auto",
"modelName": "test_model",
"modelVersion": "0.1",
"processState": "student",
"reviewed": 0,
"modelType": "student"
}
annotation_response = client.upload_annotated_data(annotation_data)
## 返回标注的ID
annotation_response.annotation_data_id
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
datalakesdk-0.0.2.tar.gz
(5.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datalakesdk-0.0.2.tar.gz.
File metadata
- Download URL: datalakesdk-0.0.2.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a80c345a63ae11b02476222b77273643d0f731363d85e59b1f034130bda38703
|
|
| MD5 |
31b1a21cb0b5e5a1ba4d69d34840c200
|
|
| BLAKE2b-256 |
63d016c099d5f4e8614303a431cbe69e7dc4dd18af6e2807fb21041659dc3d60
|
File details
Details for the file datalakesdk-0.0.2-py3-none-any.whl.
File metadata
- Download URL: datalakesdk-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35e8ec3b58029d67a3bfeadab3e33c39fb4f480f30949ac2024f7b77fff200cb
|
|
| MD5 |
6d72cc0212e543551afec2a56a4072c3
|
|
| BLAKE2b-256 |
5dbb24e8d1c5ef75d9d757307c3786470f3113e9b632fb0cc08999b8f2c6bd9a
|