@@ -24,6 +24,10 @@ ____________
24
24
.. code-block :: bash
25
25
26
26
$ pip install --upgrade scaleapi
27
+
28
+ .. code-block :: bash
29
+
30
+ $ conda install -c conda-forge scaleapi
27
31
28
32
Usage
29
33
_____
@@ -105,7 +109,31 @@ Task Attributes
105
109
106
110
The older ``param_dict `` attribute is now replaced with a method ``as_dict() `` to return a task's all attributes as a dictionary (JSON).
107
111
108
- First-level attributes of Task are accessible with ``. `` annotation as the following:
112
+ .. code-block :: python
113
+
114
+ task.as_dict()
115
+
116
+ # {
117
+ # 'task_id': '30553edd0b6a93f8f05f0fee',
118
+ # 'created_at': '2021-06-17T21:46:36.359Z',
119
+ # 'type': 'imageannotation',
120
+ # 'status': 'pending',
121
+ # ....
122
+ # 'params': {
123
+ # 'attachment': 'http://i.imgur.com/v4cBreD.jpg',
124
+ # 'attachment_type': 'image',
125
+ # 'geometries': {
126
+ # 'box': {
127
+ # 'objects_to_annotate': ['Baby Cow', 'Big Cow'],
128
+ # 'min_height': 10,
129
+ # 'min_width': 10,
130
+ # ...
131
+ # },
132
+ # 'project': 'My Project',
133
+ # ...
134
+ # }
135
+
136
+ First-level attributes of Task are also accessible with ``. `` annotation as the following:
109
137
110
138
.. code-block :: python
111
139
@@ -342,7 +370,6 @@ ________
342
370
343
371
Files are a way of uploading local files directly to Scale storage or importing files before creating tasks.
344
372
345
- The ``file.attachment_url `` can be used in place of attachments in task payload.
346
373
347
374
Upload Files
348
375
^^^^^^^^^^^^^^
@@ -359,6 +386,23 @@ __ https://docs.scale.com/reference#file-upload-1
359
386
project_name = " test_project" ,
360
387
)
361
388
389
+ The ``file.attachment_url `` can be used in place of attachments in task payload.
390
+
391
+
392
+ .. code-block :: python
393
+
394
+ my_file.as_dict()
395
+
396
+ # {
397
+ # 'attachment_url': 'scaledata://606e2a0a46102303a130949/8ac09a90-c143-4154-9a9b-6c35121396d1f',
398
+ # 'created_at': '2021-06-17T21:56:53.825Z',
399
+ # 'id': '8ac09d70-ca43-4354-9a4b-6c3591396d1f',
400
+ # 'mime_type': 'image/png',
401
+ # 'project_names': ['test_project'],
402
+ # 'size': 340714,
403
+ # 'updated_at': '2021-06-17T21:56:53.825Z'
404
+ # }
405
+
362
406
Import Files
363
407
^^^^^^^^^^^^^^
364
408
@@ -384,7 +428,7 @@ The attribute can be passed to the task payloads, in the ``attachment`` paramete
384
428
...
385
429
...
386
430
attachment_type = " image" ,
387
- attachment = my_file.attachment_url,
431
+ attachment = my_file.attachment_url, # scaledata://606e2a30949/89a90-c143-4154-9a9b-6c36d1f
388
432
...
389
433
...
390
434
)
0 commit comments