@@ -72,16 +72,18 @@ def upload_image(args):
7272 rf = roboflow .Roboflow ()
7373 workspace = rf .workspace (args .workspace )
7474 project = workspace .project (args .project )
75- project .single_upload (
76- image_path = args .imagefile ,
77- annotation_path = args .annotation ,
78- annotation_labelmap = args .labelmap ,
79- split = args .split ,
80- num_retry_uploads = args .num_retries ,
81- batch_name = args .batch ,
82- tag_names = args .tag_names .split ("," ) if args .tag_names else [],
83- is_prediction = args .is_prediction ,
84- )
75+ tag_names = args .tag_names .split ("," ) if args .tag_names else []
76+ for image_path in args .imagefile :
77+ project .single_upload (
78+ image_path = image_path ,
79+ annotation_path = args .annotation ,
80+ annotation_labelmap = args .labelmap ,
81+ split = args .split ,
82+ num_retry_uploads = args .num_retries ,
83+ batch_name = args .batch ,
84+ tag_names = tag_names ,
85+ is_prediction = args .is_prediction ,
86+ )
8587
8688
8789def upload_model (args ):
@@ -263,10 +265,11 @@ def _add_download_parser(subparsers):
263265
264266
265267def _add_upload_parser (subparsers ):
266- upload_parser = subparsers .add_parser ("upload" , help = "Upload a single image to a dataset" )
268+ upload_parser = subparsers .add_parser ("upload" , help = "Upload one or more images to a dataset" )
267269 upload_parser .add_argument (
268270 "imagefile" ,
269- help = "path to image file" ,
271+ nargs = "+" ,
272+ help = "path to one or more image files to upload" ,
270273 )
271274 upload_parser .add_argument (
272275 "-w" ,
@@ -276,7 +279,8 @@ def _add_upload_parser(subparsers):
276279 upload_parser .add_argument (
277280 "-p" ,
278281 dest = "project" ,
279- help = "project_id to upload the image into" ,
282+ required = True ,
283+ help = "project_id to upload the image into (required)" ,
280284 )
281285 upload_parser .add_argument (
282286 "-a" ,
0 commit comments