Skip to content

Commit 0c09c5c

Browse files
author
rcmangasaryan
committed
add comments on changes
1 parent 19c9f4e commit 0c09c5c

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

superannotate/db/projects.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -557,17 +557,21 @@ def upload_image_array_to_s3(
557557
project_type
558558
):
559559
bucket.put_object(Body=orig_image, Key=key)
560-
bucket.put_object(Body=lores_image, Key=key + '___lores.jpg')
560+
#TODO: uuid__lores.jpg
561+
bucket.put_object(Body=lores_image, Key=key + '___lores.jpg')
562+
561563
bucket.put_object(
562564
Body=huge_image,
565+
#TODO: uuid__huge.jpg
563566
Key=key + '___huge.jpg',
564567
Metadata={
565568
'height': str(size[1]),
566569
'width': str(size[0])
567570
}
568571
)
569572
bucket.put_object(Body=thumbnail_image, Key=key + '___thumb.jpg')
570-
postfix_json = '___objects.json' if project_type == "Vector" else '___pixel.json'
573+
# TODO: remove suffix objects, pixel: save uuid.json
574+
postfix_json = '___objects.json' if project_type == "Vector" else '___pixel.json'
571575
bucket.put_object(
572576
Body=json.dumps(create_empty_annotation(size,
573577
Path(key).name)),
@@ -703,9 +707,11 @@ def __create_image(img_paths, project, annotation_status, remote_dir):
703707
team_id, project_id = project["team_id"], project["id"]
704708
data = {
705709
"project_id": str(project_id),
706-
"team_id": str(team_id),
707-
"images": [],
710+
"team_id": str(team_id)
711+
"images": [],
708712
"annotation_status": annotation_status
713+
#TODO: {image_name: {heigh, width, annotation_path})
714+
# "meta": {"a.jpg": {"height":78, "width":56, "annotation_json_path": "remote_path/a_uuid.json" }, "b.jpg": {"height":78, "width":56, "annotation_json_path": "remote_path/b_uuid.json" } }
709715
}
710716
for img_path in img_paths:
711717
img_name = Path(img_path).name
@@ -721,7 +727,7 @@ def __create_image(img_paths, project, annotation_status, remote_dir):
721727
)
722728

723729

724-
def upload_images_to_project(
730+
o_project(
725731
project,
726732
img_paths,
727733
annotation_status="NotStarted",
@@ -1163,6 +1169,7 @@ def __upload_annotations_thread(
11631169
path='/images/getAnnotationsPathsAndTokens',
11641170
json_req=data
11651171
)
1172+
#TODO: will res["images"] = [{image_name: {annotation_json_path:, annotation_blue_map_path:}}, ]
11661173
res = response.json()
11671174
if len(res["images"]) < len(data["names"]):
11681175
for name in data["names"]:
@@ -1556,7 +1563,7 @@ def upload_preannotations_from_folder_to_project(
15561563
return _upload_preannotations_from_folder_to_project(
15571564
project, folder_path, from_s3_bucket, recursive_subfolders
15581565
)
1559-
1566+
#TODO: new endpoint to be delivered: use new endpoint to create annotation json for preannotations
15601567

15611568
def _upload_preannotations_from_folder_to_project(
15621569
project, folder_path, from_s3_bucket=None, recursive_subfolders=False
@@ -1648,6 +1655,7 @@ def _upload_preannotations_from_folder_to_project(
16481655
annotation_classes_dict = get_annotation_classes_name_to_id(
16491656
annotation_classes
16501657
)
1658+
16511659
response = _api.send_request(
16521660
req_type='GET',
16531661
path=f'/project/{project_id}/preannotation',

0 commit comments

Comments
 (0)