intellif-aihub 0.1.18__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.

Files changed (63) hide show
  1. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/PKG-INFO +1 -1
  2. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/pyproject.toml +1 -1
  3. intellif_aihub-0.1.19/src/aihub/__init__.py +1 -0
  4. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/labelfree.py +20 -0
  5. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/task_center.py +2 -2
  6. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/PKG-INFO +1 -1
  7. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_task_center.py +23 -9
  8. intellif_aihub-0.1.18/src/aihub/__init__.py +0 -1
  9. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/LICENSE +0 -0
  10. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/README.md +0 -0
  11. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/setup.cfg +0 -0
  12. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/client.py +0 -0
  13. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/exceptions.py +0 -0
  14. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/__init__.py +0 -0
  15. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/artifact.py +0 -0
  16. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/common.py +0 -0
  17. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/data_warehouse.py +0 -0
  18. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/dataset_management.py +0 -0
  19. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/document_center.py +0 -0
  20. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/eval.py +0 -0
  21. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/model_center.py +0 -0
  22. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/model_training_platform.py +0 -0
  23. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/quota_schedule_management.py +0 -0
  24. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/tag_resource_management.py +0 -0
  25. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/user_system.py +0 -0
  26. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/models/workflow_center.py +0 -0
  27. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/__init__.py +0 -0
  28. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/artifact.py +0 -0
  29. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/data_warehouse.py +0 -0
  30. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/dataset_management.py +0 -0
  31. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/document_center.py +0 -0
  32. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/eval.py +0 -0
  33. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/labelfree.py +0 -0
  34. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/model_center.py +0 -0
  35. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/model_training_platform.py +0 -0
  36. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/quota_schedule_management.py +0 -0
  37. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/reporter.py +0 -0
  38. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/tag_resource_management.py +0 -0
  39. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/task_center.py +0 -0
  40. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/user_system.py +0 -0
  41. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/services/workflow_center.py +0 -0
  42. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/utils/__init__.py +0 -0
  43. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/utils/di.py +0 -0
  44. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/utils/download.py +0 -0
  45. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/utils/http.py +0 -0
  46. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/aihub/utils/s3.py +0 -0
  47. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/SOURCES.txt +0 -0
  48. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/dependency_links.txt +0 -0
  49. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/requires.txt +0 -0
  50. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/src/intellif_aihub.egg-info/top_level.txt +0 -0
  51. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_artifact.py +0 -0
  52. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_data_warehouse.py +0 -0
  53. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_dataset_management.py +0 -0
  54. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_di.py +0 -0
  55. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_document_center.py +0 -0
  56. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_labelfree.py +0 -0
  57. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_model_center.py +0 -0
  58. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_model_training_platform.py +0 -0
  59. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_quota_schedule_management.py +0 -0
  60. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_s3.py +0 -0
  61. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_tag_resource_management.py +0 -0
  62. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_user_system.py +0 -0
  63. {intellif_aihub-0.1.18 → intellif_aihub-0.1.19}/tests/test_workflow_center.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: intellif-aihub
3
- Version: 0.1.18
3
+ Version: 0.1.19
4
4
  Summary: Intellif AI-hub SDK.
5
5
  Author-email: Platform Team <aihub@example.com>
6
6
  License-Expression: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "intellif-aihub"
3
- version = "0.1.18"
3
+ version = "0.1.19"
4
4
  description = "Intellif AI-hub SDK."
5
5
  readme = {file = "README.md", content-type = "text/markdown"}
6
6
  requires-python = ">=3.9"
@@ -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}
@@ -138,8 +138,8 @@ class LabelValidateStage(Enum):
138
138
  """10%阶段"""
139
139
  FIFTY_PERCENT = "标注阶段(50%)"
140
140
  """50%阶段"""
141
- HUNDRED_PERCENT = "标注阶段(100%)"
142
- """100%阶段(已交付)"""
141
+ LABEL_FINISHED = "标注阶段(100%)"
142
+ """标注完成"""
143
143
 
144
144
 
145
145
  class LabelValidateReq(BaseModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: intellif-aihub
3
- Version: 0.1.18
3
+ Version: 0.1.19
4
4
  Summary: Intellif AI-hub SDK.
5
5
  Author-email: Platform Team <aihub@example.com>
6
6
  License-Expression: Apache-2.0
@@ -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="test_task",
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.HUNDRED_PERCENT, True)
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.18"
File without changes