synapse-sdk 1.0.0a52__py3-none-any.whl → 1.0.0a54__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 synapse-sdk might be problematic. Click here for more details.

@@ -8,6 +8,7 @@ class ServeClientMixin(BaseClient):
8
8
  response = self._get(path, params=params)
9
9
  for key, item in response['applications'].items():
10
10
  response['applications'][key]['deployments'] = list(item['deployments'].values())
11
+ response['applications'][key]['route_prefix'] = item['route_prefix']
11
12
  return list(response['applications'].values())
12
13
 
13
14
  def get_serve_application(self, pk, params=None):
@@ -15,6 +16,7 @@ class ServeClientMixin(BaseClient):
15
16
  response = self._get(path, params=params)
16
17
  try:
17
18
  response['applications'][pk]['deployments'] = list(response['applications'][pk]['deployments'].values())
19
+ response['applications'][pk]['route_prefix'] = response['applications'][pk]['route_prefix']
18
20
  return response['applications'][pk]
19
21
  except KeyError:
20
22
  raise ClientError(404, 'Serve Application Not Found')
@@ -27,13 +27,6 @@ class ExportRun(Run):
27
27
  error: str | None = None
28
28
  created: str
29
29
 
30
- class MetricsRecord(BaseModel):
31
- """Metrics record model."""
32
-
33
- stand_by: int
34
- failed: int
35
- success: int
36
-
37
30
  def log_file(
38
31
  self, log_type: str, target_id: int, data_file_info: dict, status: ExportStatus, error: str | None = None
39
32
  ):
@@ -58,16 +51,6 @@ class ExportRun(Run):
58
51
  ).model_dump(),
59
52
  )
60
53
 
61
- def log_metrics(self, record: MetricsRecord, category: str):
62
- """Log export metrics.
63
-
64
- Args:
65
- record (MetricsRecord): The metrics record to log.
66
- category (str): The category of the metrics.
67
- """
68
- record = self.MetricsRecord.model_validate(record)
69
- self.set_metrics(value=record.dict(), category=category)
70
-
71
54
  def export_log_json_file(
72
55
  self,
73
56
  target_id: int,
@@ -280,7 +263,6 @@ class ExportAction(Action):
280
263
  'proportion': 100,
281
264
  }
282
265
  }
283
- metrics_categories = {'data_file', 'original_file'}
284
266
 
285
267
  def get_filtered_results(self, filters, handler):
286
268
  """Get filtered target results."""
@@ -42,8 +42,6 @@ def export(run, export_items, path_root, **params):
42
42
  origin_files_output_path.mkdir(parents=True, exist_ok=True)
43
43
 
44
44
  total = params['count']
45
- original_file_metrics_record = run.MetricsRecord(stand_by=total, success=0, failed=0)
46
- data_file_metrics_record = run.MetricsRecord(stand_by=total, success=0, failed=0)
47
45
  # progress init
48
46
  run.set_progress(0, total, category='dataset_conversion')
49
47
  for no, export_item in enumerate(export_items, start=1):
@@ -58,30 +56,12 @@ def export(run, export_items, path_root, **params):
58
56
  if save_original_file_flag:
59
57
  if no == 1:
60
58
  run.log_message('Saving original file.')
61
- original_status = save_original_file(run, final_data, origin_files_output_path, errors_original_file_list)
62
-
63
- original_file_metrics_record.stand_by -= 1
64
- if original_status == ExportStatus.FAILED:
65
- original_file_metrics_record.failed += 1
66
- continue
67
- else:
68
- original_file_metrics_record.success += 1
69
-
70
- run.log_metrics(record=original_file_metrics_record, category='original_file')
59
+ save_original_file(run, final_data, origin_files_output_path, errors_original_file_list)
71
60
 
72
61
  # Extract data as JSON files
73
62
  if no == 1:
74
63
  run.log_message('Saving json file.')
75
- data_status = save_as_json(run, final_data, json_output_path, errors_json_file_list)
76
-
77
- data_file_metrics_record.stand_by -= 1
78
- if data_status == ExportStatus.FAILED:
79
- data_file_metrics_record.failed += 1
80
- continue
81
- else:
82
- data_file_metrics_record.success += 1
83
-
84
- run.log_metrics(record=data_file_metrics_record, category='data_file')
64
+ save_as_json(run, final_data, json_output_path, errors_json_file_list)
85
65
 
86
66
  run.end_log()
87
67
 
@@ -146,7 +126,6 @@ def save_original_file(run, result, base_path, error_file_list):
146
126
  status = ExportStatus.FAILED
147
127
 
148
128
  run.export_log_original_file(result['id'], file_info, status, error_msg)
149
- return status
150
129
 
151
130
 
152
131
  def save_as_json(run, result, base_path, error_file_list):
@@ -173,4 +152,3 @@ def save_as_json(run, result, base_path, error_file_list):
173
152
  status = ExportStatus.FAILED
174
153
 
175
154
  run.export_log_json_file(result['id'], file_info, status, error_msg)
176
- return status
@@ -105,6 +105,8 @@ class UploadParams(BaseModel):
105
105
  storage: int
106
106
  collection: int
107
107
  project: int | None
108
+ is_generate_tasks: bool = False
109
+ is_generate_ground_truths: bool = False
108
110
 
109
111
  @field_validator('storage', mode='before')
110
112
  @classmethod
@@ -163,6 +165,8 @@ class UploadAction(Action):
163
165
  analyze_collection: The progress category for the analyze collection process.
164
166
  data_file_upload: The progress category for the upload process.
165
167
  generate_data_units: The progress category for the generate data units process.
168
+ generate_tasks: The progress category for the generate tasks process.
169
+ generate_ground_truths: The progress category for the generate ground truths process.
166
170
  """
167
171
 
168
172
  name = 'upload'
@@ -171,16 +175,48 @@ class UploadAction(Action):
171
175
  run_class = UploadRun
172
176
  progress_categories = {
173
177
  'analyze_collection': {
174
- 'proportion': 10,
178
+ 'proportion': 0,
175
179
  },
176
180
  'upload_data_files': {
177
- 'proportion': 50,
181
+ 'proportion': 0,
178
182
  },
179
183
  'generate_data_units': {
180
- 'proportion': 40,
184
+ 'proportion': 0,
185
+ },
186
+ 'generate_tasks': {
187
+ 'proportion': 0,
188
+ },
189
+ 'generate_ground_truths': {
190
+ 'proportion': 0,
181
191
  },
182
192
  }
183
193
 
194
+ def __init__(self, *args, **kwargs):
195
+ """Initialize UploadAction."""
196
+ super().__init__(*args, **kwargs)
197
+
198
+ # Setup progress categories ratio by options.
199
+ progress_ratios = {
200
+ 'upload_only': (5, 60, 35, 0, 0),
201
+ 'generate_tasks': (5, 45, 25, 25, 0),
202
+ 'generate_ground_truths': (5, 35, 30, 15, 15),
203
+ }
204
+ options = kwargs['plugin_config']['actions']['upload']['options']
205
+ progress_categories = self.progress_categories
206
+ if options['allow_generate_tasks'] and not kwargs['params']['allow_generate_ground_truths']:
207
+ ratio_name = 'generate_tasks'
208
+ elif options['allow_generate_ground_truths'] and kwargs['params']['allow_generate_tasks']:
209
+ ratio_name = 'generate_ground_truths'
210
+ else:
211
+ ratio_name = 'upload_only'
212
+
213
+ assert len(progress_categories) == len(progress_ratios[ratio_name]), (
214
+ 'Progress categories and ratios length mismatch.'
215
+ )
216
+ for i, category in enumerate(progress_categories):
217
+ progress_categories[category]['proportion'] = progress_ratios[ratio_name][i]
218
+ self.progress_categories = progress_categories
219
+
184
220
  def get_uploader(self, path):
185
221
  """Get uploader from entrypoint."""
186
222
  return self.entrypoint(self.run, path)
@@ -229,6 +265,26 @@ class UploadAction(Action):
229
265
  generated_data_units = self._generate_data_units(uploaded_files, upload_result_count)
230
266
  result['generated_data_units_count'] = len(generated_data_units)
231
267
 
268
+ # Setup task with uploaded synapse-backend data units.
269
+ if not len(generated_data_units):
270
+ self.run.log_message('No data units were generated.', context=Context.WARNING.value)
271
+ self.run.end_log()
272
+ return result
273
+
274
+ if self.config['options']['allow_generate_tasks'] and self.params['is_generate_tasks']:
275
+ generated_tasks = self._generate_tasks(generated_data_units)
276
+ result['generated_tasks_count'] = len(generated_tasks)
277
+ else:
278
+ self.run.log_message('Generating tasks process has passed.')
279
+
280
+ # Generate ground truths for the uploaded data.
281
+ # TODO: Need to add ground truths generation logic later.
282
+ if self.config['options']['allow_generate_ground_truths'] and self.params['is_generate_ground_truths']:
283
+ generated_ground_truths = self._generate_ground_truths()
284
+ result['generated_ground_truths_count'] = len(generated_ground_truths)
285
+ else:
286
+ self.run.log_message('Generating ground truths process has passed.')
287
+
232
288
  self.run.end_log()
233
289
  return result
234
290
 
@@ -313,3 +369,53 @@ class UploadAction(Action):
313
369
  self.run.set_progress(upload_result_count, upload_result_count, category='generate_data_units')
314
370
 
315
371
  return sum(generated_data_units, [])
372
+
373
+ def _generate_tasks(self, generated_data_units: List) -> List:
374
+ """Setup task with uploaded synapse-backend data units.
375
+
376
+ TODO: make batch size configurable.
377
+ """
378
+ # Initialize progress
379
+ self.run.set_progress(0, 1, category='generate_tasks')
380
+ self.run.log_message('Generating tasks with data files...')
381
+
382
+ # Prepare batches for processing
383
+ client = self.run.client
384
+ project_id = self.params['project']
385
+ current_progress = 0
386
+
387
+ # Generate tasks
388
+ generated_tasks = []
389
+ generated_data_units_count = len(generated_data_units)
390
+ for data_unit in generated_data_units:
391
+ tasks_data = []
392
+ task_data = {'project': project_id, 'data_unit': data_unit['id']}
393
+ tasks_data.append(task_data)
394
+ if tasks_data:
395
+ created_tasks = client.create_tasks(tasks_data)
396
+ created_task_ids = [created_task['id'] for created_task in created_tasks]
397
+ generated_tasks.append(created_task_ids)
398
+ for created_task_id in created_task_ids:
399
+ self.run.log_task(created_task_id, UploadStatus.SUCCESS)
400
+
401
+ self.run.set_progress(current_progress, generated_data_units_count, category='generate_tasks')
402
+ current_progress += 1
403
+
404
+ # Finish progress
405
+ self.run.log_message('Generating tasks completed')
406
+ self.run.set_progress(1, 1, category='generate_tasks')
407
+
408
+ return sum(generated_tasks, [])
409
+
410
+ def _generate_ground_truths(self):
411
+ """Generate ground truths for the uploaded data.
412
+
413
+ TODO: Need to add ground truths generation logic later.
414
+ """
415
+ # Initialize progress
416
+ self.run.set_progress(0, 1, category='generate_ground_truths')
417
+ self.run.log_message('Generating ground truths...')
418
+
419
+ # Finish progress
420
+ self.run.log_message('Generating ground truths completed')
421
+ self.run.set_progress(1, 1, category='generate_ground_truths')
@@ -1,10 +1,9 @@
1
1
  actions:
2
2
  upload:
3
3
  entrypoint: plugin.upload.Uploader
4
+ options:
5
+ allow_generate_tasks: false # Allow the plugin to generate tasks for the uploaded data
6
+ allow_generate_ground_truths: false # Allow the plugin to generate ground truths for the uploaded data
4
7
  supported_data_type: image # A primary data type of synapse backend collection. (e.g. 'image', 'text', 'video', 'pcd', 'audio')
5
8
  ui_schema: |
6
9
  Dumped FormKit Schema for upload plugin custom options
7
- task_pre_annotation:
8
- entrypoint: plugin.upload.TaskPreAnnotation
9
- ui_schema: |
10
- Dumped FormKit Schema for upload plugin custom options
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synapse-sdk
3
- Version: 1.0.0a52
3
+ Version: 1.0.0a54
4
4
  Summary: synapse sdk
5
5
  Author-email: datamaker <developer@datamaker.io>
6
6
  License: MIT
@@ -38,7 +38,7 @@ synapse_sdk/clients/backend/ml.py,sha256=JoPH9Ly2E3HJ7S5mdGLtcGq7ruQVVrYfWArogwZ
38
38
  synapse_sdk/clients/backend/models.py,sha256=s5d9sGGQ0Elj0HOGC1TuwE-eBkY1aTfJPl6ls11bNCk,1961
39
39
  synapse_sdk/clients/ray/__init__.py,sha256=9ZSPXVVxlJ8Wp8ku7l021ENtPjVrGgQDgqifkkVAXgM,187
40
40
  synapse_sdk/clients/ray/core.py,sha256=a4wyCocAma2HAm-BHlbZnoVbpfdR-Aad2FM0z6vPFvw,731
41
- synapse_sdk/clients/ray/serve.py,sha256=rbCpXZYWf0oP8XJ9faa9QFNPYU7h8dltIG8xn9ZconY,907
41
+ synapse_sdk/clients/ray/serve.py,sha256=eFhCYIv_irc_2RyuV3bzeWIVyz_1NlqwoNVh5KSWilY,1092
42
42
  synapse_sdk/clients/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  synapse_sdk/clients/validators/collections.py,sha256=LtnwvutsScubOUcZ2reGHLCzseXxtNIdnH2nv098aUU,1195
44
44
  synapse_sdk/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -61,10 +61,10 @@ synapse_sdk/plugins/categories/data_validation/templates/plugin/validation.py,sh
61
61
  synapse_sdk/plugins/categories/export/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  synapse_sdk/plugins/categories/export/enums.py,sha256=gtyngvQ1DKkos9iKGcbecwTVQQ6sDwbrBPSGPNb5Am0,127
63
63
  synapse_sdk/plugins/categories/export/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
- synapse_sdk/plugins/categories/export/actions/export.py,sha256=2lIjur8EiwTB9sc16FV8ZaPXFxUtGRPx9hreG_DKLQA,10483
64
+ synapse_sdk/plugins/categories/export/actions/export.py,sha256=xqPB_MufeMP3riaKCbGVFGukV8RdXcg6-zUrkw4t1-A,9922
65
65
  synapse_sdk/plugins/categories/export/templates/config.yaml,sha256=N7YmnFROb3s3M35SA9nmabyzoSb5O2t2TRPicwFNN2o,56
66
66
  synapse_sdk/plugins/categories/export/templates/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
- synapse_sdk/plugins/categories/export/templates/plugin/export.py,sha256=zG8mSn7ZGIj8cttWmb7GEPcGgQRbZ97brJCzkuK7RP8,6106
67
+ synapse_sdk/plugins/categories/export/templates/plugin/export.py,sha256=JA2Y_A30QyJekSqDq8PeRuFR9k0yjQjOG-Xy6C8zPew,5196
68
68
  synapse_sdk/plugins/categories/neural_net/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
69
  synapse_sdk/plugins/categories/neural_net/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
70
  synapse_sdk/plugins/categories/neural_net/actions/deployment.py,sha256=y2LrS-pwazqRI5O0q1NUy45NQYsBj6ykbrXnDMs_fqE,1987
@@ -100,11 +100,9 @@ synapse_sdk/plugins/categories/smart_tool/templates/plugin/__init__.py,sha256=47
100
100
  synapse_sdk/plugins/categories/smart_tool/templates/plugin/auto_label.py,sha256=eevNg0nOcYFR4z_L_R-sCvVOYoLWSAH1jwDkAf3YCjY,320
101
101
  synapse_sdk/plugins/categories/upload/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
102
102
  synapse_sdk/plugins/categories/upload/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
103
- synapse_sdk/plugins/categories/upload/actions/task_pre_annotation.py,sha256=SehWN55Turhyv_GEBpetykvB4-mZnoDL0h5XlWszPe8,3058
104
- synapse_sdk/plugins/categories/upload/actions/upload.py,sha256=3qjuvH28BfMdBK2bOTo-GlqoF24eKPX10hFhha0-GEk,11278
105
- synapse_sdk/plugins/categories/upload/templates/config.yaml,sha256=1O0kMfkFMGYwnpBcttrlC9bu4xzU9docw2MBOq_Elmo,417
103
+ synapse_sdk/plugins/categories/upload/actions/upload.py,sha256=8FIRkEtSPTToSZBYn7B2qaTj9778RDjr84BHnn6ajSM,15951
104
+ synapse_sdk/plugins/categories/upload/templates/config.yaml,sha256=kwHNWHFYbzDi1mEh40KozatPZbZGH44dlP0t0J7ejJw,483
106
105
  synapse_sdk/plugins/categories/upload/templates/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
- synapse_sdk/plugins/categories/upload/templates/plugin/task_pre_annotation.py,sha256=9XkUZu7USjVjDPufM0NlYmkdKfV7Hf_9v5GN1RgZzS0,350
108
106
  synapse_sdk/plugins/categories/upload/templates/plugin/upload.py,sha256=dnK8gy33GjG5ettayawDJv1gM3xCm1K6lM-PfeeTjQw,1163
109
107
  synapse_sdk/plugins/templates/cookiecutter.json,sha256=NxOWk9A_v1pO0Ny4IYT9Cj5iiJ16--cIQrGC67QdR0I,396
110
108
  synapse_sdk/plugins/templates/hooks/post_gen_project.py,sha256=jqlYkY1O2TxIR-Vh3gnwILYy8k-D39Xx66d2KNQVMCs,147
@@ -136,9 +134,9 @@ synapse_sdk/utils/storage/providers/__init__.py,sha256=x7RGwZryT2FpVxS7fGWryRVpq
136
134
  synapse_sdk/utils/storage/providers/gcp.py,sha256=i2BQCu1Kej1If9SuNr2_lEyTcr5M_ncGITZrL0u5wEA,363
137
135
  synapse_sdk/utils/storage/providers/s3.py,sha256=W94rQvhGRXti3R4mYP7gmU5pcyCQpGFIBLvxxqLVdRM,2231
138
136
  synapse_sdk/utils/storage/providers/sftp.py,sha256=_8s9hf0JXIO21gvm-JVS00FbLsbtvly4c-ETLRax68A,1426
139
- synapse_sdk-1.0.0a52.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
140
- synapse_sdk-1.0.0a52.dist-info/METADATA,sha256=HXeyrqhs7vO8PtUOUf4hy7XREJYywB-Mq55s_Oa4CjQ,1303
141
- synapse_sdk-1.0.0a52.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
142
- synapse_sdk-1.0.0a52.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
143
- synapse_sdk-1.0.0a52.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
144
- synapse_sdk-1.0.0a52.dist-info/RECORD,,
137
+ synapse_sdk-1.0.0a54.dist-info/licenses/LICENSE,sha256=bKzmC5YAg4V1Fhl8OO_tqY8j62hgdncAkN7VrdjmrGk,1101
138
+ synapse_sdk-1.0.0a54.dist-info/METADATA,sha256=JHOOafiDzcZBZjHOAL8AUzlEjhWs1YyLz6VH4jCGK4I,1303
139
+ synapse_sdk-1.0.0a54.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
140
+ synapse_sdk-1.0.0a54.dist-info/entry_points.txt,sha256=VNptJoGoNJI8yLXfBmhgUefMsmGI0m3-0YoMvrOgbxo,48
141
+ synapse_sdk-1.0.0a54.dist-info/top_level.txt,sha256=ytgJMRK1slVOKUpgcw3LEyHHP7S34J6n_gJzdkcSsw8,12
142
+ synapse_sdk-1.0.0a54.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,101 +0,0 @@
1
- from enum import Enum
2
- from typing import Annotated
3
-
4
- from pydantic import AfterValidator, BaseModel, field_validator
5
- from pydantic_core import PydanticCustomError
6
-
7
- from synapse_sdk.clients.exceptions import ClientError
8
- from synapse_sdk.plugins.categories.base import Action
9
- from synapse_sdk.plugins.categories.decorators import register_action
10
- from synapse_sdk.plugins.enums import PluginCategory, RunMethod
11
- from synapse_sdk.plugins.models import Run
12
- from synapse_sdk.utils.pydantic.validators import non_blank
13
-
14
-
15
- class TaskDataAnnotationType(str, Enum):
16
- FILE = 'file'
17
- INFERENCE = 'inference'
18
-
19
-
20
- class TaskPreAnnotationRun(Run):
21
- pass
22
-
23
-
24
- class TaskPreAnnotationParams(BaseModel):
25
- """TaskPreAnnotation action parameters.
26
-
27
- Args:
28
- name (str): The name of the action.
29
- description (str | None): The description of the action.
30
- project (int): The project ID.
31
- data_collection (int): The data collection ID.
32
- task_data_annotation_type (TaskDataAnnotationType): The type of task data annotation.
33
- """
34
-
35
- name: Annotated[str, AfterValidator(non_blank)]
36
- description: str | None
37
- project: int
38
- data_collection: int
39
- task_data_annotation_type: TaskDataAnnotationType
40
-
41
- @field_validator('data_collection', mode='before')
42
- @classmethod
43
- def check_data_collection_exists(cls, value: str, info) -> str:
44
- """Validate synapse-backend collection exists."""
45
- action = info.context['action']
46
- client = action.client
47
- try:
48
- client.get_dataset(value)
49
- except ClientError:
50
- raise PydanticCustomError('client_error', 'Error occurred while checking data collection exists.')
51
- return value
52
-
53
- @field_validator('project', mode='before')
54
- @classmethod
55
- def check_project_exists(cls, value: str, info) -> str:
56
- """Validate synapse-backend project exists."""
57
- if not value:
58
- return value
59
-
60
- action = info.context['action']
61
- client = action.client
62
- try:
63
- client.get_project(value)
64
- except ClientError:
65
- raise PydanticCustomError('client_error', 'Error occurred while checking project exists.')
66
- return value
67
-
68
-
69
- @register_action
70
- class TaskPreAnnotationAction(Action):
71
- """TaskPreAnnotation action class.
72
-
73
- * Annotate data to tasks.
74
- """
75
-
76
- name = 'task_pre_annotation'
77
- category = PluginCategory.UPLOAD
78
- method = RunMethod.JOB
79
- run_class = TaskPreAnnotationRun
80
- progress_categories = {
81
- 'generate_tasks': {
82
- 'proportion': 10,
83
- },
84
- 'annotate_task_data': {
85
- 'proportion': 90,
86
- },
87
- }
88
-
89
- def start(self):
90
- """Start task_pre_annotation action.
91
-
92
- * Generate tasks.
93
- * Annotate data to tasks.
94
- """
95
- task_pre_annotation = self.get_task_pre_annotation()
96
- task_pre_annotation.handle_annotate_data_from_files()
97
- return {}
98
-
99
- def get_task_pre_annotation(self):
100
- """Get task pre annotation entrypoint."""
101
- return self.entrypoint()
@@ -1,14 +0,0 @@
1
- class TaskPreAnnotation:
2
- def __init__(self, run, *args, **kwargs):
3
- """Initialize the plugin task pre annotation action class.
4
-
5
- Args:
6
- run: Plugin run object.
7
- """
8
- self.run = run
9
-
10
- def handle_annotate_data_from_files(self):
11
- pass
12
-
13
- def handle_annotate_data_with_inference(self):
14
- pass