File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -538,11 +538,12 @@ def upload_images_from_folder_to_project(
538538 )
539539
540540
541- def create_empty_annotation (size ):
541+ def create_empty_annotation (size , image_name ):
542542 return {
543543 "metadata" : {
544544 'height' : size [1 ],
545- 'width' : size [0 ]
545+ 'width' : size [0 ],
546+ 'name' : image_name
546547 },
547548 "instances" : [],
548549 "comments" : [],
@@ -567,7 +568,9 @@ def upload_image_array_to_s3(
567568 bucket .put_object (Body = thumbnail_image , Key = key + '___thumb.jpg' )
568569 postfix_json = '___objects.json' if project_type == "Vector" else '___pixel.json'
569570 bucket .put_object (
570- Body = json .dumps (create_empty_annotation (size )), Key = key + postfix_json
571+ Body = json .dumps (create_empty_annotation (size ,
572+ Path (key ).name )),
573+ Key = key + postfix_json
571574 )
572575
573576
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ def test_meta_init(tmpdir):
2727 print (annot )
2828 assert annot ["metadata" ]["width" ] == size [1 ]
2929 assert annot ["metadata" ]["height" ] == size [0 ]
30- assert len (annot ["metadata" ]) == 2
30+ assert annot ["metadata" ]["name" ] == image .name
31+ assert len (annot ["metadata" ]) == 3
3132
3233 sa .download_export (project , sa .prepare_export (project ), tmpdir )
You can’t perform that action at this time.
0 commit comments