intellif-aihub 0.1.17__tar.gz → 0.1.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of intellif-aihub might be problematic. Click here for more details.
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/PKG-INFO +1 -1
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/pyproject.toml +1 -1
- intellif_aihub-0.1.19/src/aihub/__init__.py +1 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/labelfree.py +20 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/task_center.py +4 -1
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/task_center.py +2 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/PKG-INFO +1 -1
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_task_center.py +23 -9
- intellif_aihub-0.1.17/src/aihub/__init__.py +0 -1
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/LICENSE +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/README.md +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/setup.cfg +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/client.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/exceptions.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/__init__.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/artifact.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/common.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/data_warehouse.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/dataset_management.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/document_center.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/eval.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/model_center.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/model_training_platform.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/quota_schedule_management.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/tag_resource_management.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/user_system.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/workflow_center.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/__init__.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/artifact.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/data_warehouse.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/dataset_management.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/document_center.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/eval.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/labelfree.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/model_center.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/model_training_platform.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/quota_schedule_management.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/reporter.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/tag_resource_management.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/user_system.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/workflow_center.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/utils/__init__.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/utils/di.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/utils/download.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/utils/http.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/utils/s3.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/SOURCES.txt +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/dependency_links.txt +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/requires.txt +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/top_level.txt +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_artifact.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_data_warehouse.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_dataset_management.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_di.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_document_center.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_labelfree.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_model_center.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_model_training_platform.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_quota_schedule_management.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_s3.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_tag_resource_management.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_user_system.py +0 -0
- {intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/tests/test_workflow_center.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.19"
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from enum import Enum
|
|
3
4
|
from typing import Optional
|
|
4
5
|
|
|
5
6
|
from pydantic import BaseModel, Field
|
|
6
7
|
|
|
7
8
|
|
|
9
|
+
class LabelProjectStatus(Enum):
|
|
10
|
+
"""标注状态"""
|
|
11
|
+
|
|
12
|
+
Pending = "pending"
|
|
13
|
+
"""未开始"""
|
|
14
|
+
Loading = "loading"
|
|
15
|
+
"""数据读取中"""
|
|
16
|
+
Error = "failed"
|
|
17
|
+
"""数据读取异常"""
|
|
18
|
+
In_Progress = "ready"
|
|
19
|
+
"""进行中"""
|
|
20
|
+
Finished = "finished"
|
|
21
|
+
"""标注完成"""
|
|
22
|
+
|
|
23
|
+
|
|
8
24
|
class Stats(BaseModel):
|
|
9
25
|
"""标注统计信息"""
|
|
26
|
+
|
|
10
27
|
total_annotations: int = Field(alias="total_annotations", description="总数据量")
|
|
11
28
|
labeled_annotations: int = Field(alias="labeled_annotations", description="已标注数据量")
|
|
12
29
|
total_labels: int = Field(alias="total_labels", description="总标签量")
|
|
@@ -19,9 +36,12 @@ class Stats(BaseModel):
|
|
|
19
36
|
|
|
20
37
|
class GetGlobalStatsResponse(BaseModel):
|
|
21
38
|
"""标注统计概况"""
|
|
39
|
+
|
|
22
40
|
global_stats: Stats = Field(alias="global_stats")
|
|
23
41
|
valid_ten_percent: bool = Field(alias="valid_ten_percent", description="是否完成验收10%")
|
|
24
42
|
valid_fifty_percent: bool = Field(alias="valid_fifty_percent", description="是否完成验收50%")
|
|
25
43
|
valid_hundred_percent: bool = Field(alias="valid_hundred_percent", description="是否完成验收100%")
|
|
26
44
|
data_exported_count: int = Field(alias="data_exported_count", description="已导出数据次数")
|
|
27
45
|
exported_dataset_name: str = Field(alias="exported_dataset_name", description="最新数据集名称")
|
|
46
|
+
status: LabelProjectStatus = Field(description="状态")
|
|
47
|
+
model_config = {"use_enum_values": True}
|
|
@@ -135,8 +135,11 @@ class LabelValidateStage(Enum):
|
|
|
135
135
|
"""任务验收阶段"""
|
|
136
136
|
|
|
137
137
|
TEN_PERCENT = "标注阶段(10%)"
|
|
138
|
+
"""10%阶段"""
|
|
138
139
|
FIFTY_PERCENT = "标注阶段(50%)"
|
|
139
|
-
|
|
140
|
+
"""50%阶段"""
|
|
141
|
+
LABEL_FINISHED = "标注阶段(100%)"
|
|
142
|
+
"""标注完成"""
|
|
140
143
|
|
|
141
144
|
|
|
142
145
|
class LabelValidateReq(BaseModel):
|
|
@@ -13,6 +13,7 @@ from __future__ import annotations
|
|
|
13
13
|
import datetime
|
|
14
14
|
|
|
15
15
|
import httpx
|
|
16
|
+
from loguru import logger
|
|
16
17
|
|
|
17
18
|
from .tag_resource_management import TagResourceManagementService
|
|
18
19
|
from .user_system import UserSystemService
|
|
@@ -200,6 +201,7 @@ task_priority="low", estimated_delivery_at= "2025-08-01")
|
|
|
200
201
|
stage=stage,
|
|
201
202
|
)
|
|
202
203
|
self.task_center.validate_label_project(task_id=task_id, payload=req)
|
|
204
|
+
logger.info(f"标注项目: {label_project_name} 完成了: {stage}, 验收结果: {passed}")
|
|
203
205
|
|
|
204
206
|
|
|
205
207
|
class _TaskCenter:
|
|
@@ -12,14 +12,16 @@ TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjQ5MDY2ODUwODAsImlhdCI6MT
|
|
|
12
12
|
|
|
13
13
|
class TestTaskCenter(unittest.TestCase):
|
|
14
14
|
def test_create_label_task(self):
|
|
15
|
-
from src.aihub.models.task_center import LabelProjectTypeEnum
|
|
15
|
+
from src.aihub.models.task_center import LabelProjectTypeEnum, LabelValidateStage
|
|
16
16
|
from src.aihub.client import Client
|
|
17
17
|
from src.aihub.models.task_center import TaskCenterPriorityEnum
|
|
18
|
+
from src.aihub.models.labelfree import LabelProjectStatus
|
|
19
|
+
import time
|
|
18
20
|
|
|
19
21
|
# 创建任务
|
|
20
22
|
client = Client(base_url=BASE_URL, token=TOKEN)
|
|
21
23
|
task_id = client.task_center.create_label_task(
|
|
22
|
-
name="
|
|
24
|
+
name="test_tas2k232",
|
|
23
25
|
dataset_version_name="re/V1",
|
|
24
26
|
feishu_doc_name="人脸质量人脸照片分类",
|
|
25
27
|
task_receiver_name="hyc",
|
|
@@ -34,18 +36,24 @@ class TestTaskCenter(unittest.TestCase):
|
|
|
34
36
|
# 获取任务信息
|
|
35
37
|
task_item = client.task_center.get(task_id)
|
|
36
38
|
# 使用sdkl
|
|
39
|
+
if not task_item.other_info.label_projects:
|
|
40
|
+
print("任务未完成,请稍后...")
|
|
41
|
+
time.sleep(5)
|
|
42
|
+
continue
|
|
37
43
|
p = task_item.other_info.label_projects[0]
|
|
38
44
|
label_stats = client.labelfree.get_project_global_stats(p.label_project_name)
|
|
39
45
|
# 等待标注完成、完成100%验收、存在数据导出
|
|
40
|
-
if
|
|
41
|
-
(label_stats.global_stats.total_annotations == label_stats.global_stats.labeled_annotations)
|
|
42
|
-
and (label_stats.valid_hundred_percent)
|
|
43
|
-
and label_stats.data_exported_count != 0
|
|
44
|
-
):
|
|
46
|
+
if label_stats.status == LabelProjectStatus.Finished and label_stats.data_exported_count != 0:
|
|
45
47
|
exported_dataset_name = label_stats.exported_dataset_name
|
|
48
|
+
client.task_center.validate_label_project(
|
|
49
|
+
task_id, p.label_project_name, LabelValidateStage.LABEL_FINISHED, True
|
|
50
|
+
)
|
|
46
51
|
|
|
47
|
-
client.task_center.validate_label_project(task_id, {})
|
|
48
52
|
break
|
|
53
|
+
else:
|
|
54
|
+
print("任务未完成,请稍后...")
|
|
55
|
+
time.sleep(5)
|
|
56
|
+
continue
|
|
49
57
|
|
|
50
58
|
# 下载数据
|
|
51
59
|
client.dataset_management.run_download(exported_dataset_name, local_dir="./output")
|
|
@@ -56,4 +64,10 @@ class TestTaskCenter(unittest.TestCase):
|
|
|
56
64
|
from src.aihub.models.task_center import LabelValidateStage
|
|
57
65
|
|
|
58
66
|
client = Client(base_url=BASE_URL, token=TOKEN)
|
|
59
|
-
client.task_center.validate_label_project(1923, "project_893437", LabelValidateStage.
|
|
67
|
+
client.task_center.validate_label_project(1923, "project_893437", LabelValidateStage.LABEL_FINISHED, True)
|
|
68
|
+
|
|
69
|
+
def test_get_label_project(self):
|
|
70
|
+
from src.aihub.client import Client
|
|
71
|
+
|
|
72
|
+
client = Client(base_url=BASE_URL, token=TOKEN)
|
|
73
|
+
client.labelfree.get_project_global_stats("project_889552")
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.17"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/models/quota_schedule_management.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/model_training_platform.py
RENAMED
|
File without changes
|
{intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/quota_schedule_management.py
RENAMED
|
File without changes
|
|
File without changes
|
{intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/aihub/services/tag_resource_management.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{intellif_aihub-0.1.17 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|