superb-ai-onprem 0.6.3__py3-none-any.whl → 0.7.1__py3-none-any.whl
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 superb-ai-onprem might be problematic. Click here for more details.
- spb_onprem/__init__.py +5 -0
- spb_onprem/_version.py +2 -2
- spb_onprem/activities/entities/activity.py +24 -17
- spb_onprem/activities/entities/activity_history.py +15 -12
- spb_onprem/data/entities/__init__.py +3 -0
- spb_onprem/data/entities/annotation.py +18 -13
- spb_onprem/data/entities/comment.py +43 -0
- spb_onprem/data/entities/data.py +31 -17
- spb_onprem/data/entities/data_meta.py +1 -1
- spb_onprem/data/entities/data_slice.py +14 -9
- spb_onprem/data/entities/frame.py +12 -9
- spb_onprem/data/entities/prediction.py +7 -5
- spb_onprem/data/entities/scene.py +9 -7
- spb_onprem/data/enums/__init__.py +1 -0
- spb_onprem/data/enums/data_meta_type.py +0 -1
- spb_onprem/data/params/data_list.py +240 -49
- spb_onprem/data/params/update_data.py +5 -6
- spb_onprem/data/params/update_data_slice.py +17 -6
- spb_onprem/data/queries.py +19 -0
- spb_onprem/data/service.py +7 -5
- spb_onprem/datasets/entities/dataset.py +13 -7
- spb_onprem/entities.py +6 -0
- spb_onprem/exports/entities/export.py +18 -15
- spb_onprem/slices/entities/slice.py +13 -10
- superb_ai_onprem-0.7.1.dist-info/METADATA +285 -0
- {superb_ai_onprem-0.6.3.dist-info → superb_ai_onprem-0.7.1.dist-info}/RECORD +29 -28
- superb_ai_onprem-0.6.3.dist-info/METADATA +0 -246
- {superb_ai_onprem-0.6.3.dist-info → superb_ai_onprem-0.7.1.dist-info}/WHEEL +0 -0
- {superb_ai_onprem-0.6.3.dist-info → superb_ai_onprem-0.7.1.dist-info}/licenses/LICENSE +0 -0
- {superb_ai_onprem-0.6.3.dist-info → superb_ai_onprem-0.7.1.dist-info}/top_level.txt +0 -0
|
@@ -4,53 +4,164 @@ from spb_onprem.data.enums import DataType, DataStatus
|
|
|
4
4
|
from spb_onprem.exceptions import BadParameterError
|
|
5
5
|
|
|
6
6
|
# === 기본 필터 ===
|
|
7
|
+
|
|
7
8
|
class DateTimeRangeFilterOption(CustomBaseModel):
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
"""
|
|
10
|
+
날짜/시간 범위 필터 옵션
|
|
11
|
+
|
|
12
|
+
사용 예시:
|
|
13
|
+
# 범위 필터
|
|
14
|
+
{"from": "2025-01-01T00:00:00Z", "to": "2025-12-31T23:59:59Z"}
|
|
15
|
+
|
|
16
|
+
# 정확한 날짜
|
|
17
|
+
{"equals": "2025-09-17T10:00:00Z"}
|
|
18
|
+
|
|
19
|
+
# 시작 날짜만
|
|
20
|
+
{"from": "2025-01-01T00:00:00Z"}
|
|
21
|
+
"""
|
|
22
|
+
datetime_from: Optional[str] = Field(None, alias="from", description="시작 날짜/시간 (ISO 8601 형식)")
|
|
23
|
+
to: Optional[str] = Field(None, description="종료 날짜/시간 (ISO 8601 형식)")
|
|
24
|
+
equals: Optional[str] = Field(None, description="정확한 날짜/시간 (ISO 8601 형식)")
|
|
25
|
+
|
|
11
26
|
|
|
12
27
|
class UserFilterOption(CustomBaseModel):
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
"""
|
|
29
|
+
사용자 필터 옵션 (생성자, 수정자 등)
|
|
30
|
+
|
|
31
|
+
사용 예시:
|
|
32
|
+
# 정확한 사용자
|
|
33
|
+
{"equals": "user@example.com"}
|
|
34
|
+
|
|
35
|
+
# 부분 일치
|
|
36
|
+
{"contains": "admin"}
|
|
37
|
+
|
|
38
|
+
# 여러 사용자 중 하나
|
|
39
|
+
{"in": ["user1@example.com", "user2@example.com"]}
|
|
40
|
+
|
|
41
|
+
# 사용자 존재 여부
|
|
42
|
+
{"exists": True}
|
|
43
|
+
"""
|
|
44
|
+
equals: Optional[str] = Field(None, description="정확한 사용자 이메일")
|
|
45
|
+
contains: Optional[str] = Field(None, description="사용자 이메일에 포함된 문자열")
|
|
46
|
+
user_in: Optional[List[str]] = Field(None, alias="in", description="사용자 이메일 목록 중 하나")
|
|
47
|
+
exists: Optional[bool] = Field(None, description="사용자 정보 존재 여부")
|
|
48
|
+
|
|
17
49
|
|
|
18
50
|
class NumericRangeFilter(CustomBaseModel):
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
51
|
+
"""
|
|
52
|
+
숫자 범위 필터
|
|
53
|
+
|
|
54
|
+
사용 예시:
|
|
55
|
+
# 범위 필터
|
|
56
|
+
{"gte": 0.8, "lt": 1.0} # 0.8 이상 1.0 미만
|
|
57
|
+
|
|
58
|
+
# 정확한 값
|
|
59
|
+
{"equals": 5}
|
|
60
|
+
|
|
61
|
+
# 단일 조건
|
|
62
|
+
{"gt": 10} # 10보다 큰 값
|
|
63
|
+
"""
|
|
64
|
+
gt: Optional[float] = Field(None, description="초과 (greater than)")
|
|
65
|
+
gte: Optional[float] = Field(None, description="이상 (greater than or equal)")
|
|
66
|
+
lt: Optional[float] = Field(None, description="미만 (less than)")
|
|
67
|
+
lte: Optional[float] = Field(None, description="이하 (less than or equal)")
|
|
68
|
+
equals: Optional[float] = Field(None, description="정확한 값")
|
|
69
|
+
|
|
24
70
|
|
|
25
71
|
class GeoLocationFilter(CustomBaseModel):
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
72
|
+
"""
|
|
73
|
+
지리적 위치 필터 (위도, 경도, 반경)
|
|
74
|
+
|
|
75
|
+
사용 예시:
|
|
76
|
+
{
|
|
77
|
+
"latitude": 37.5665,
|
|
78
|
+
"longitude": 126.9780,
|
|
79
|
+
"radiusInMeters": 1000
|
|
80
|
+
}
|
|
81
|
+
"""
|
|
82
|
+
latitude: float = Field(..., description="위도 (-90 ~ 90)")
|
|
83
|
+
longitude: float = Field(..., description="경도 (-180 ~ 180)")
|
|
84
|
+
radius_in_meters: float = Field(..., alias="radiusInMeters", description="반경 (미터 단위)")
|
|
29
85
|
|
|
30
86
|
# === Meta 필터 ===
|
|
87
|
+
|
|
31
88
|
class NumberMetaFilter(CustomBaseModel):
|
|
32
|
-
|
|
33
|
-
|
|
89
|
+
"""
|
|
90
|
+
숫자형 메타데이터 필터
|
|
91
|
+
|
|
92
|
+
사용 예시:
|
|
93
|
+
{
|
|
94
|
+
"key": "confidence_score",
|
|
95
|
+
"range": {"gte": 0.8, "lt": 1.0}
|
|
96
|
+
}
|
|
97
|
+
"""
|
|
98
|
+
key: str = Field(..., description="메타데이터 키 이름")
|
|
99
|
+
range: Optional[NumericRangeFilter] = Field(None, description="숫자 범위 조건")
|
|
34
100
|
|
|
35
101
|
class KeywordMetaFilter(CustomBaseModel):
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
102
|
+
"""
|
|
103
|
+
키워드/텍스트형 메타데이터 필터
|
|
104
|
+
|
|
105
|
+
사용 예시:
|
|
106
|
+
# 정확한 일치
|
|
107
|
+
{"key": "category", "equals": "vehicle"}
|
|
108
|
+
|
|
109
|
+
# 부분 일치
|
|
110
|
+
{"key": "tags", "contains": "outdoor"}
|
|
111
|
+
|
|
112
|
+
# 여러 값 중 하나
|
|
113
|
+
{"key": "status", "in": ["active", "pending"]}
|
|
114
|
+
"""
|
|
115
|
+
key: str = Field(..., description="메타데이터 키 이름")
|
|
116
|
+
equals: Optional[str] = Field(None, description="정확한 값")
|
|
117
|
+
contains: Optional[str] = Field(None, description="포함된 문자열")
|
|
118
|
+
keyword_in: Optional[List[str]] = Field(None, alias="in", description="값 목록 중 하나")
|
|
119
|
+
|
|
40
120
|
|
|
41
121
|
class DateMetaFilter(CustomBaseModel):
|
|
42
|
-
|
|
43
|
-
|
|
122
|
+
"""
|
|
123
|
+
날짜형 메타데이터 필터
|
|
124
|
+
|
|
125
|
+
사용 예시:
|
|
126
|
+
{
|
|
127
|
+
"key": "capture_date",
|
|
128
|
+
"range": {
|
|
129
|
+
"from": "2025-01-01T00:00:00Z",
|
|
130
|
+
"to": "2025-06-30T23:59:59Z"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
"""
|
|
134
|
+
key: str = Field(..., description="메타데이터 키 이름")
|
|
135
|
+
range: Optional[DateTimeRangeFilterOption] = Field(None, description="날짜 범위 조건")
|
|
136
|
+
|
|
44
137
|
|
|
45
138
|
class MiscMetaFilter(CustomBaseModel):
|
|
46
|
-
|
|
47
|
-
|
|
139
|
+
"""
|
|
140
|
+
기타 메타데이터 필터 (정확한 일치만 지원)
|
|
141
|
+
|
|
142
|
+
사용 예시:
|
|
143
|
+
{"key": "custom_field", "equals": "specific_value"}
|
|
144
|
+
"""
|
|
145
|
+
key: str = Field(..., description="메타데이터 키 이름")
|
|
146
|
+
equals: str = Field(..., description="정확한 값")
|
|
147
|
+
|
|
48
148
|
|
|
49
149
|
class MetaFilter(CustomBaseModel):
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
150
|
+
"""
|
|
151
|
+
메타데이터 필터 컨테이너
|
|
152
|
+
|
|
153
|
+
사용 예시:
|
|
154
|
+
{
|
|
155
|
+
"num": [{"key": "confidence", "range": {"gte": 0.8}}],
|
|
156
|
+
"keyword": [{"key": "category", "equals": "vehicle"}],
|
|
157
|
+
"date": [{"key": "capture_date", "range": {"from": "2025-01-01T00:00:00Z"}}],
|
|
158
|
+
"misc": [{"key": "custom", "equals": "value"}]
|
|
159
|
+
}
|
|
160
|
+
"""
|
|
161
|
+
num: Optional[List[NumberMetaFilter]] = Field(None, description="숫자형 메타데이터 필터 목록")
|
|
162
|
+
keyword: Optional[List[KeywordMetaFilter]] = Field(None, description="키워드형 메타데이터 필터 목록")
|
|
163
|
+
date: Optional[List[DateMetaFilter]] = Field(None, description="날짜형 메타데이터 필터 목록")
|
|
164
|
+
misc: Optional[List[MiscMetaFilter]] = Field(None, description="기타 메타데이터 필터 목록")
|
|
54
165
|
|
|
55
166
|
# === Count 필터 ===
|
|
56
167
|
class CountFilter(CustomBaseModel):
|
|
@@ -79,20 +190,43 @@ class FrameFilterOptions(CustomBaseModel):
|
|
|
79
190
|
counts: Optional[FrameCountsFilter] = None
|
|
80
191
|
|
|
81
192
|
# === Data 필터 ===
|
|
193
|
+
|
|
82
194
|
class DataFilterOptions(CustomBaseModel):
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
195
|
+
"""
|
|
196
|
+
데이터 필터링 옵션 (기본 데이터 속성 필터)
|
|
197
|
+
|
|
198
|
+
사용 예시:
|
|
199
|
+
DataFilterOptions(
|
|
200
|
+
type_in=["IMAGE", "VIDEO"],
|
|
201
|
+
key_contains="sample_",
|
|
202
|
+
created_at={"from": "2025-01-01T00:00:00Z"},
|
|
203
|
+
meta={"keyword": [{"key": "category", "equals": "vehicle"}]}
|
|
204
|
+
)
|
|
205
|
+
"""
|
|
206
|
+
# ID 및 키 필터
|
|
207
|
+
id_in: Optional[List[str]] = Field(None, alias="idIn", description="특정 데이터 ID 목록 중 하나")
|
|
208
|
+
slice_id_in: Optional[List[str]] = Field(None, alias="sliceIdIn", description="특정 슬라이스 ID 목록에 속한 데이터")
|
|
209
|
+
|
|
210
|
+
# 키 패턴 필터
|
|
211
|
+
key_contains: Optional[str] = Field(None, alias="keyContains", description="키에 포함된 문자열")
|
|
212
|
+
key_matches: Optional[str] = Field(None, alias="keyMatches", description="키와 매칭되는 정규식 패턴")
|
|
213
|
+
|
|
214
|
+
# 타입 필터
|
|
215
|
+
sub_type_contains: Optional[str] = Field(None, alias="subTypeContains", description="서브타입에 포함된 문자열")
|
|
216
|
+
sub_type_matches: Optional[str] = Field(None, alias="subTypeMatches", description="서브타입과 매칭되는 정규식 패턴")
|
|
217
|
+
type_in: Optional[List[str]] = Field(None, alias="typeIn", description="데이터 타입 목록 중 하나 (IMAGE, VIDEO 등)")
|
|
218
|
+
|
|
219
|
+
# 날짜 필터
|
|
220
|
+
created_at: Optional[DateTimeRangeFilterOption] = Field(None, alias="createdAt", description="생성일 범위")
|
|
221
|
+
updated_at: Optional[DateTimeRangeFilterOption] = Field(None, alias="updatedAt", description="수정일 범위")
|
|
222
|
+
|
|
223
|
+
# 사용자 필터
|
|
224
|
+
created_by: Optional[UserFilterOption] = Field(None, alias="createdBy", description="생성자 필터")
|
|
225
|
+
updated_by: Optional[UserFilterOption] = Field(None, alias="updatedBy", description="수정자 필터")
|
|
226
|
+
|
|
227
|
+
# 메타데이터 및 기타
|
|
228
|
+
meta: Optional[MetaFilter] = Field(None, description="커스텀 메타데이터 필터")
|
|
229
|
+
assigned_to_user: Optional[str] = Field(None, alias="assignedToUser", description="할당된 사용자")
|
|
96
230
|
|
|
97
231
|
class DataSliceStatusFilterOption(CustomBaseModel):
|
|
98
232
|
status_in: Optional[List[str]] = Field(None, alias="in")
|
|
@@ -148,10 +282,67 @@ class DataFilter(CustomBaseModel):
|
|
|
148
282
|
|
|
149
283
|
|
|
150
284
|
class DataListFilter(CustomBaseModel):
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
285
|
+
"""
|
|
286
|
+
데이터 리스트 필터 - 메인 필터 클래스
|
|
287
|
+
|
|
288
|
+
논리 연산자를 사용한 복합 필터링을 지원합니다:
|
|
289
|
+
- must_filter: AND 조건 (모든 조건이 참이어야 함)
|
|
290
|
+
- not_filter: NOT 조건 (모든 조건이 거짓이어야 함)
|
|
291
|
+
- slice: 특정 슬라이스 내에서 필터링
|
|
292
|
+
- frames: 프레임 레벨 필터링 (비디오 데이터용)
|
|
293
|
+
|
|
294
|
+
사용 예시:
|
|
295
|
+
# 기본 필터
|
|
296
|
+
DataListFilter(
|
|
297
|
+
must_filter=DataFilterOptions(
|
|
298
|
+
type_in=["IMAGE"],
|
|
299
|
+
key_contains="sample_"
|
|
300
|
+
)
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
# 복합 필터 (AND + NOT)
|
|
304
|
+
DataListFilter(
|
|
305
|
+
must_filter=DataFilterOptions(type_in=["IMAGE"]),
|
|
306
|
+
not_filter=DataFilterOptions(key_contains="test_")
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
# 슬라이스 특정 필터
|
|
310
|
+
DataListFilter(
|
|
311
|
+
slice={
|
|
312
|
+
"id": "slice-123",
|
|
313
|
+
"must": {"status": {"in": ["LABELED"]}}
|
|
314
|
+
}
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
# Dictionary에서 생성 (alias 사용 필수)
|
|
318
|
+
filter_dict = {
|
|
319
|
+
"must": {
|
|
320
|
+
"typeIn": ["IMAGE"],
|
|
321
|
+
"keyContains": "sample_"
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
filter = DataListFilter.model_validate(filter_dict)
|
|
325
|
+
"""
|
|
326
|
+
must_filter: Optional[DataFilterOptions] = Field(
|
|
327
|
+
None,
|
|
328
|
+
alias="must",
|
|
329
|
+
description="AND 조건 - 모든 조건이 참이어야 함"
|
|
330
|
+
)
|
|
331
|
+
not_filter: Optional[DataFilterOptions] = Field(
|
|
332
|
+
None,
|
|
333
|
+
alias="not",
|
|
334
|
+
description="NOT 조건 - 모든 조건이 거짓이어야 함"
|
|
335
|
+
)
|
|
336
|
+
slice: Optional[DataSliceFilter] = Field(
|
|
337
|
+
None,
|
|
338
|
+
alias="slice",
|
|
339
|
+
description="슬라이스별 필터링"
|
|
340
|
+
)
|
|
341
|
+
frames: Optional[List[FrameFilter]] = Field(
|
|
342
|
+
None,
|
|
343
|
+
alias="frames",
|
|
344
|
+
description="프레임 레벨 필터 목록 (비디오 데이터용)"
|
|
345
|
+
)
|
|
155
346
|
|
|
156
347
|
|
|
157
348
|
def get_data_id_list_params(
|
|
@@ -169,13 +360,13 @@ def get_data_id_list_params(
|
|
|
169
360
|
length (Optional[int], optional): The length of the data list. Defaults to 50.
|
|
170
361
|
|
|
171
362
|
Raises:
|
|
172
|
-
BadParameterError: The maximum length is
|
|
363
|
+
BadParameterError: The maximum length is 50.
|
|
173
364
|
|
|
174
365
|
Returns:
|
|
175
366
|
dict: The variables for the dataIdList query.
|
|
176
367
|
"""
|
|
177
|
-
if length >
|
|
178
|
-
raise BadParameterError("The maximum length is
|
|
368
|
+
if length > 50:
|
|
369
|
+
raise BadParameterError("The maximum length is 50.")
|
|
179
370
|
return {
|
|
180
371
|
"dataset_id": dataset_id,
|
|
181
372
|
"filter": data_filter.model_dump(by_alias=True, exclude_unset=True) if data_filter else None,
|
|
@@ -28,10 +28,9 @@ def update_params(
|
|
|
28
28
|
|
|
29
29
|
Args:
|
|
30
30
|
dataset_id (str): The dataset ID of the data.
|
|
31
|
-
|
|
31
|
+
data_id (str): The ID of the data.
|
|
32
32
|
key (str): The key of the data.
|
|
33
33
|
meta (List[DataMeta]): The meta of the data.
|
|
34
|
-
system_meta (List[DataMeta]): The system meta of the data.
|
|
35
34
|
"""
|
|
36
35
|
variables = {
|
|
37
36
|
"datasetId": dataset_id,
|
|
@@ -46,11 +45,11 @@ def update_params(
|
|
|
46
45
|
raise ValueError("meta must be a list of DataMeta or None.")
|
|
47
46
|
variables["meta"] = [
|
|
48
47
|
{
|
|
49
|
-
"key":
|
|
50
|
-
"type":
|
|
51
|
-
"value":
|
|
48
|
+
"key": meta_item.key,
|
|
49
|
+
"type": meta_item.type.value,
|
|
50
|
+
"value": meta_item.value,
|
|
52
51
|
}
|
|
53
|
-
for
|
|
52
|
+
for meta_item in meta
|
|
54
53
|
] if meta is not None else None
|
|
55
54
|
|
|
56
55
|
return variables
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
from typing import Any
|
|
1
|
+
from typing import Any, Optional, Union
|
|
2
|
+
from spb_onprem.base_types import (
|
|
3
|
+
Undefined,
|
|
4
|
+
UndefinedType,
|
|
5
|
+
)
|
|
2
6
|
|
|
3
7
|
|
|
4
8
|
def update_data_slice_params(
|
|
5
9
|
dataset_id: str,
|
|
6
10
|
data_id: str,
|
|
7
11
|
slice_id: str,
|
|
8
|
-
meta:
|
|
12
|
+
meta: Union[
|
|
13
|
+
Optional[dict],
|
|
14
|
+
UndefinedType
|
|
15
|
+
] = Undefined,
|
|
9
16
|
):
|
|
10
17
|
"""Make the variables for the updateDataSlice query.
|
|
11
18
|
|
|
@@ -13,11 +20,15 @@ def update_data_slice_params(
|
|
|
13
20
|
dataset_id (str): The dataset ID of the data.
|
|
14
21
|
data_id (str): The ID of the data.
|
|
15
22
|
slice_id (str): The slice ID.
|
|
16
|
-
meta (
|
|
23
|
+
meta (dict): The meta of the data slice.
|
|
17
24
|
"""
|
|
18
|
-
|
|
25
|
+
params = {
|
|
19
26
|
"dataset_id": dataset_id,
|
|
20
27
|
"data_id": data_id,
|
|
21
28
|
"slice_id": slice_id,
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if meta is not Undefined:
|
|
32
|
+
params["meta"] = meta
|
|
33
|
+
|
|
34
|
+
return params
|
spb_onprem/data/queries.py
CHANGED
|
@@ -97,6 +97,25 @@ class Schemas:
|
|
|
97
97
|
}
|
|
98
98
|
meta
|
|
99
99
|
}
|
|
100
|
+
comments {
|
|
101
|
+
id
|
|
102
|
+
category
|
|
103
|
+
comment
|
|
104
|
+
status
|
|
105
|
+
replies {
|
|
106
|
+
id
|
|
107
|
+
comment
|
|
108
|
+
createdAt
|
|
109
|
+
createdBy
|
|
110
|
+
updatedAt
|
|
111
|
+
updatedBy
|
|
112
|
+
}
|
|
113
|
+
meta
|
|
114
|
+
updatedAt
|
|
115
|
+
updatedBy
|
|
116
|
+
createdAt
|
|
117
|
+
createdBy
|
|
118
|
+
}
|
|
100
119
|
meta
|
|
101
120
|
}
|
|
102
121
|
meta
|
spb_onprem/data/service.py
CHANGED
|
@@ -19,6 +19,7 @@ from .entities import (
|
|
|
19
19
|
AnnotationVersion,
|
|
20
20
|
Prediction,
|
|
21
21
|
Frame,
|
|
22
|
+
DataMeta,
|
|
22
23
|
)
|
|
23
24
|
from .enums import (
|
|
24
25
|
DataStatus,
|
|
@@ -195,7 +196,7 @@ class DataService(BaseService):
|
|
|
195
196
|
UndefinedType,
|
|
196
197
|
] = Undefined,
|
|
197
198
|
meta: Union[
|
|
198
|
-
List[
|
|
199
|
+
List[DataMeta],
|
|
199
200
|
UndefinedType,
|
|
200
201
|
] = Undefined,
|
|
201
202
|
):
|
|
@@ -205,7 +206,7 @@ class DataService(BaseService):
|
|
|
205
206
|
dataset_id (str): The dataset id.
|
|
206
207
|
data_id (str): The data id.
|
|
207
208
|
key (Union[str, UndefinedType], optional): The key of the data. Defaults to Undefined.
|
|
208
|
-
meta (Union[List[
|
|
209
|
+
meta (Union[List[DataMeta], UndefinedType], optional): The meta data. Defaults to Undefined.
|
|
209
210
|
|
|
210
211
|
Returns:
|
|
211
212
|
Data: The updated data.
|
|
@@ -715,7 +716,10 @@ class DataService(BaseService):
|
|
|
715
716
|
dataset_id: str,
|
|
716
717
|
data_id: str,
|
|
717
718
|
slice_id: str,
|
|
718
|
-
meta:
|
|
719
|
+
meta: Union[
|
|
720
|
+
Optional[dict],
|
|
721
|
+
UndefinedType
|
|
722
|
+
] = Undefined,
|
|
719
723
|
):
|
|
720
724
|
"""Update the metadata of a data slice.
|
|
721
725
|
|
|
@@ -734,8 +738,6 @@ class DataService(BaseService):
|
|
|
734
738
|
raise BadParameterError("data_id is required.")
|
|
735
739
|
if slice_id is None:
|
|
736
740
|
raise BadParameterError("slice_id is required.")
|
|
737
|
-
if meta is None:
|
|
738
|
-
raise BadParameterError("meta is required.")
|
|
739
741
|
|
|
740
742
|
response = self.request_gql(
|
|
741
743
|
Queries.UPDATE_DATA_SLICE,
|
|
@@ -4,11 +4,17 @@ from spb_onprem.data.entities.data import Data
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class Dataset(CustomBaseModel):
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
"""
|
|
8
|
+
데이터셋 엔터티
|
|
9
|
+
|
|
10
|
+
데이터를 그룹화하고 관리하는 컨테이너입니다.
|
|
11
|
+
프로젝트별, 도메인별로 데이터를 조직화하는 데 사용됩니다.
|
|
12
|
+
"""
|
|
13
|
+
id: Optional[str] = Field(None, description="데이터셋 고유 식별자")
|
|
14
|
+
name: Optional[str] = Field(None, description="데이터셋 이름")
|
|
15
|
+
description: Optional[str] = Field(None, description="데이터셋 설명")
|
|
10
16
|
|
|
11
|
-
created_at: Optional[str] = Field(None, alias="createdAt")
|
|
12
|
-
updated_at: Optional[str] = Field(None, alias="updatedAt")
|
|
13
|
-
created_by: Optional[str] = Field(None, alias="createdBy")
|
|
14
|
-
updated_by: Optional[str] = Field(None, alias="updatedBy")
|
|
17
|
+
created_at: Optional[str] = Field(None, alias="createdAt", description="생성일시 (ISO 8601)")
|
|
18
|
+
updated_at: Optional[str] = Field(None, alias="updatedAt", description="수정일시 (ISO 8601)")
|
|
19
|
+
created_by: Optional[str] = Field(None, alias="createdBy", description="생성자")
|
|
20
|
+
updated_by: Optional[str] = Field(None, alias="updatedBy", description="수정자")
|
spb_onprem/entities.py
CHANGED
|
@@ -7,7 +7,10 @@ from .data.entities import (
|
|
|
7
7
|
DataMeta,
|
|
8
8
|
DataSlice,
|
|
9
9
|
Frame,
|
|
10
|
+
Comment,
|
|
11
|
+
Reply,
|
|
10
12
|
)
|
|
13
|
+
from .data.entities.comment import CommentStatus
|
|
11
14
|
from .datasets.entities import Dataset
|
|
12
15
|
from .slices.entities import Slice
|
|
13
16
|
from .data.enums import (
|
|
@@ -47,6 +50,8 @@ __all__ = [
|
|
|
47
50
|
"Frame",
|
|
48
51
|
"PredictionSet",
|
|
49
52
|
"Model",
|
|
53
|
+
"Comment",
|
|
54
|
+
"Reply",
|
|
50
55
|
|
|
51
56
|
# Enums
|
|
52
57
|
"DataType",
|
|
@@ -57,4 +62,5 @@ __all__ = [
|
|
|
57
62
|
"ActivityStatus",
|
|
58
63
|
"ActivitySchema",
|
|
59
64
|
"SchemaType",
|
|
65
|
+
"CommentStatus",
|
|
60
66
|
]
|
|
@@ -5,23 +5,26 @@ from spb_onprem.data.params import DataListFilter
|
|
|
5
5
|
|
|
6
6
|
class Export(CustomBaseModel):
|
|
7
7
|
"""
|
|
8
|
-
|
|
8
|
+
익스포트 엔터티
|
|
9
|
+
|
|
10
|
+
데이터와 어노테이션을 외부 시스템에서 사용할 수 있는 형태로
|
|
11
|
+
내보내기 작업을 정의합니다. 다양한 포맷(COCO, YOLO, Custom)을 지원합니다.
|
|
9
12
|
"""
|
|
10
|
-
id: str = Field(..., alias="id")
|
|
11
|
-
dataset_id: str = Field(..., alias="datasetId")
|
|
13
|
+
id: str = Field(..., alias="id", description="익스포트 고유 식별자")
|
|
14
|
+
dataset_id: str = Field(..., alias="datasetId", description="상위 데이터셋 ID")
|
|
12
15
|
|
|
13
|
-
name: Optional[str] = Field(None, alias="name")
|
|
14
|
-
data_filter: Optional[DataListFilter] = Field(None, alias="dataFilter")
|
|
15
|
-
location: Optional[str] = Field(None, alias="location")
|
|
16
|
+
name: Optional[str] = Field(None, alias="name", description="익스포트 작업 이름")
|
|
17
|
+
data_filter: Optional[DataListFilter] = Field(None, alias="dataFilter", description="내보낼 데이터 필터 조건")
|
|
18
|
+
location: Optional[str] = Field(None, alias="location", description="익스포트 파일 저장 위치")
|
|
16
19
|
|
|
17
|
-
data_count: Optional[int] = Field(None, alias="dataCount")
|
|
18
|
-
annotation_count: Optional[int] = Field(None, alias="annotationCount")
|
|
19
|
-
frame_count: Optional[int] = Field(None, alias="frameCount")
|
|
20
|
+
data_count: Optional[int] = Field(None, alias="dataCount", description="내보낸 데이터 개수")
|
|
21
|
+
annotation_count: Optional[int] = Field(None, alias="annotationCount", description="내보낸 어노테이션 개수")
|
|
22
|
+
frame_count: Optional[int] = Field(None, alias="frameCount", description="내보낸 프레임 개수")
|
|
20
23
|
|
|
21
|
-
meta: Optional[dict] = Field(None, alias="meta")
|
|
24
|
+
meta: Optional[dict] = Field(None, alias="meta", description="익스포트 메타데이터 (포맷, 옵션 등)")
|
|
22
25
|
|
|
23
|
-
created_at: Optional[str] = Field(None, alias="createdAt")
|
|
24
|
-
created_by: Optional[str] = Field(None, alias="createdBy")
|
|
25
|
-
updated_at: Optional[str] = Field(None, alias="updatedAt")
|
|
26
|
-
updated_by: Optional[str] = Field(None, alias="updatedBy")
|
|
27
|
-
completed_at: Optional[str] = Field(None, alias="completedAt")
|
|
26
|
+
created_at: Optional[str] = Field(None, alias="createdAt", description="생성일시 (ISO 8601)")
|
|
27
|
+
created_by: Optional[str] = Field(None, alias="createdBy", description="생성자")
|
|
28
|
+
updated_at: Optional[str] = Field(None, alias="updatedAt", description="수정일시 (ISO 8601)")
|
|
29
|
+
updated_by: Optional[str] = Field(None, alias="updatedBy", description="수정자")
|
|
30
|
+
completed_at: Optional[str] = Field(None, alias="completedAt", description="완료일시 (ISO 8601)")
|
|
@@ -4,14 +4,17 @@ from spb_onprem.base_model import CustomBaseModel, Field
|
|
|
4
4
|
|
|
5
5
|
class Slice(CustomBaseModel):
|
|
6
6
|
"""
|
|
7
|
-
|
|
7
|
+
슬라이스 엔터티
|
|
8
|
+
|
|
9
|
+
데이터셋 내에서 특정 조건으로 필터링된 데이터 그룹입니다.
|
|
10
|
+
프로젝트 단계별, 작업자별, 품질별로 데이터를 분류하고 관리하는 데 사용됩니다.
|
|
8
11
|
"""
|
|
9
|
-
id: Optional[str] = None
|
|
10
|
-
dataset_id: Optional[str] = Field(None, alias="datasetId")
|
|
11
|
-
name: Optional[str] = None
|
|
12
|
-
description: Optional[str] = None
|
|
13
|
-
is_pinned: Optional[bool] = Field(None, alias="isPinned")
|
|
14
|
-
created_at: Optional[str] = Field(None, alias="createdAt")
|
|
15
|
-
created_by: Optional[str] = Field(None, alias="createdBy")
|
|
16
|
-
updated_at: Optional[str] = Field(None, alias="updatedAt")
|
|
17
|
-
updated_by: Optional[str] = Field(None, alias="updatedBy")
|
|
12
|
+
id: Optional[str] = Field(None, description="슬라이스 고유 식별자")
|
|
13
|
+
dataset_id: Optional[str] = Field(None, alias="datasetId", description="상위 데이터셋 ID")
|
|
14
|
+
name: Optional[str] = Field(None, description="슬라이스 이름")
|
|
15
|
+
description: Optional[str] = Field(None, description="슬라이스 설명")
|
|
16
|
+
is_pinned: Optional[bool] = Field(None, alias="isPinned", description="즐겨찾기 고정 여부")
|
|
17
|
+
created_at: Optional[str] = Field(None, alias="createdAt", description="생성일시 (ISO 8601)")
|
|
18
|
+
created_by: Optional[str] = Field(None, alias="createdBy", description="생성자")
|
|
19
|
+
updated_at: Optional[str] = Field(None, alias="updatedAt", description="수정일시 (ISO 8601)")
|
|
20
|
+
updated_by: Optional[str] = Field(None, alias="updatedBy", description="수정자")
|