You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When enabled, Label Studio automatically lists files from the storage bucket and constructs tasks. This is only possible for simple labeling tasks that involve a single media source (such as an image, text, etc.).*
If you plan to load JSON tasks from the Source Storage (`Treat every bucket object as a source file = No`), you must place only one task as the **dict** per one JSON file. Otherwise, Label Studio will not load your data properly.
80
+
You may put multiple tasks inside the same JSON file, but not mix task formats inside the same file.
90
81
91
-
{% details <b>Example with tasks in separate JSON files</b> %}
82
+
{% details <b>Example with bare tasks</b> %}
92
83
93
84
94
85
`task_01.json`
@@ -107,11 +98,27 @@ If you plan to load JSON tasks from the Source Storage (`Treat every bucket obje
107
98
}
108
99
```
109
100
101
+
Or:
102
+
103
+
`tasks.json`
104
+
```
105
+
[
106
+
{
107
+
"image": "s3://bucket/1.jpg",
108
+
"text": "opossums are awesome"
109
+
},
110
+
{
111
+
"image": "s3://bucket/2.jpg",
112
+
"text": "cats are awesome"
113
+
}
114
+
]
115
+
```
116
+
110
117
{% enddetails %}
111
118
112
119
<br>
113
120
114
-
{% details <b>Example with tasks, annotations and predictions in separate JSON files</b> %}
121
+
{% details <b>Example with tasks, annotations and predictions</b> %}
115
122
116
123
`task_with_predictions_and_annotations_01.json`
117
124
```
@@ -137,28 +144,39 @@ If you plan to load JSON tasks from the Source Storage (`Treat every bucket obje
137
144
}
138
145
```
139
146
140
-
{% enddetails %}
141
-
142
-
<br>
147
+
Or:
143
148
144
-
{% details <b>Python script to split a single JSON file with multiple tasks</b> %}
149
+
`tasks_with_predictions_and_annotations.json`
150
+
```
151
+
[
152
+
{
153
+
"data": {
154
+
"image": "s3://bucket/1.jpg",
155
+
"text": "opossums are awesome"
156
+
},
157
+
"annotations": [...],
158
+
"predictions": [...]
159
+
},
160
+
{
161
+
"data": {
162
+
"image": "s3://bucket/2.jpg",
163
+
"text": "cats are awesome"
164
+
}
165
+
"annotations": [...],
166
+
"predictions": [...]
167
+
}
168
+
]
169
+
```
145
170
146
-
Python script to split a single JSON file containing multiple tasks into separate JSON files, each containing one task:
171
+
{% enddetails %}
147
172
148
-
```python
149
-
import sys
150
-
import json
173
+
<br>
151
174
152
-
input_json = sys.argv[1]
153
-
withopen(input_json) as inp:
154
-
tasks = json.load(inp)
175
+
###### On
155
176
156
-
for i, v inenumerate(tasks):
157
-
withopen(f'task_{i}.json', 'w') as f:
158
-
json.dump(v, f)
159
-
```
177
+
When enabled, Label Studio automatically lists files from the storage bucket and constructs tasks. This is only possible for simple labeling tasks that involve a single media source (such as an image, text, etc.).*
0 commit comments