@@ -43,14 +43,20 @@ def import_data(
4343 api_key : Annotated [str , typer .Option (envvar = "LABEL_STUDIO_API_KEY" )],
4444 project_id : Annotated [int , typer .Option (help = "Label Studio Project ID" )],
4545 dataset_path : Annotated [
46- Path , typer .Option (help = "Path to the Label Studio dataset file" , file_okay = True )
46+ Path ,
47+ typer .Option (
48+ help = "Path to the Label Studio dataset JSONL file" , file_okay = True
49+ ),
4750 ],
4851 label_studio_url : str = LABEL_STUDIO_DEFAULT_URL ,
4952 batch_size : int = 25 ,
5053):
5154 """Import tasks from a dataset file to a Label Studio project.
5255
53- The dataset file should contain one JSON object per line."""
56+ The dataset file must be a JSONL file: it should contain one JSON object
57+ per line. To generate such a file, you can use the `create-dataset-file`
58+ command.
59+ """
5460 import more_itertools
5561 import tqdm
5662 from label_studio_sdk .client import LabelStudio
@@ -375,11 +381,16 @@ def create_dataset_file(
375381 typer .Option (help = "Path to a list of image URLs" , exists = True ),
376382 ],
377383 output_file : Annotated [
378- Path , typer .Option (help = "Path to the output JSON file" , exists = False )
384+ Path , typer .Option (help = "Path to the output JSONL file" , exists = False )
379385 ],
380386):
381387 """Create a Label Studio object detection dataset file from a list of
382- image URLs."""
388+ image URLs.
389+
390+ The output file is a JSONL file. It cannot be imported directly in Label
391+ Studio (which requires a JSON file as input), the `import-data` command
392+ should be used to import the generated dataset file.
393+ """
383394 from urllib .parse import urlparse
384395
385396 import tqdm
0 commit comments