Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ ______________________
**Updated**

- ``SAClient.get_annotations_per_frame()`` Added interpolation of polygonal and polyline annotations.

**Fixed**

- ``SAClient.add_contributors_to_project()`` method.
- ``SAClient.run_prediction()`` method.

**Removed**

- ``SAClient.create_project_from_metadata()`` method.
Expand Down
21 changes: 13 additions & 8 deletions src/superannotate/lib/core/usecases/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ async def distribute_queues(self, items_to_upload: List[ItemToUpload]):
if not processed:
try:
item_to_upload.file = io.StringIO()
json.dump(item_to_upload.annotation_json, item_to_upload.file)
json.dump(
item_to_upload.annotation_json,
item_to_upload.file,
allow_nan=False,
)
item_to_upload.file.seek(0, os.SEEK_END)
item_to_upload.file_size = item_to_upload.file.tell()
item_to_upload.file.seek(0)
Expand All @@ -358,11 +362,13 @@ async def distribute_queues(self, items_to_upload: List[ItemToUpload]):
break
self._small_files_queue.put_nowait(item_to_upload)
break
except Exception:
logger.debug(traceback.format_exc())
self._report.failed_annotations.append(
item_to_upload.annotation_json["metadata"]["name"]
)
except Exception as e:
name = item_to_upload.annotation_json["metadata"]["name"]
if isinstance(e, ValueError):
logger.debug(f"Invalid annotation {name}: {e}")
else:
logger.debug(traceback.format_exc())
self._report.failed_annotations.append(name)
self.reporter.update_progress()
data[idx][1] = True # noqa
processed_count += 1
Expand Down Expand Up @@ -784,7 +790,6 @@ def execute(self):
try:
run_async(self.run_workers(items_to_upload))
except Exception as e:
raise e
logger.debug(e)
self._response.errors = AppException("Can't upload annotations.")
self.reporter.finish_progress()
Expand Down Expand Up @@ -977,7 +982,7 @@ def execute(self):
)
if not errors:
annotation_file = io.StringIO()
json.dump(annotation_json, annotation_file)
json.dump(annotation_json, annotation_file, allow_nan=False)
size = annotation_file.tell()
annotation_file.seek(0)
if size > BIG_FILE_THRESHOLD:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ async def upload_big_annotation(
),
params=params,
headers=headers,
data=json.dumps({"data_chunk": chunk}),
data=json.dumps({"data_chunk": chunk}, allow_nan=False),
)
if not response.ok:
raise AppException(str(await response.text()))
Expand Down
179 changes: 179 additions & 0 deletions tests/data_set/sample_vector_annotations_with_NaN/classes/classes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
[
{
"id": 55917,
"project_id": 11979,
"name": "Personal vehicle",
"color": "#ecb65f",
"count": 25,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:48:19.000Z",
"attribute_groups": [
{
"id": 17245,
"class_id": 55917,
"name": "Num doors",
"is_multiselect": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z",
"attributes": [
{
"id": 62792,
"group_id": 17245,
"project_id": 11979,
"name": "2",
"count": 1,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:46:28.000Z"
},
{
"id": 62793,
"group_id": 17245,
"project_id": 11979,
"name": "4",
"count": 1,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z"
}
]
}
]
},
{
"id": 55918,
"project_id": 11979,
"name": "Large vehicle",
"color": "#737b28",
"count": 1,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:48:19.000Z",
"attribute_groups": [
{
"id": 17246,
"class_id": 55918,
"name": "swedish",
"is_multiselect": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z",
"attributes": [
{
"id": 62794,
"group_id": 17246,
"project_id": 11979,
"name": "yes",
"count": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z"
},
{
"id": 62795,
"group_id": 17246,
"project_id": 11979,
"name": "no",
"count": 1,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:46:28.000Z"
}
]
},
{
"id": 17247,
"class_id": 55918,
"name": "Num doors",
"is_multiselect": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z",
"attributes": [
{
"id": 62796,
"group_id": 17247,
"project_id": 11979,
"name": "2",
"count": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z"
},
{
"id": 62797,
"group_id": 17247,
"project_id": 11979,
"name": "4",
"count": 1,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:46:28.000Z"
}
]
}
]
},
{
"id": 55919,
"project_id": 11979,
"name": "Human",
"color": "#e4542b",
"count": 9,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:48:14.000Z",
"attribute_groups": [
{
"id": 17248,
"class_id": 55919,
"name": "Height",
"is_multiselect": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z",
"attributes": [
{
"id": 62798,
"group_id": 17248,
"project_id": 11979,
"name": "Tall",
"count": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z"
},
{
"id": 62799,
"group_id": 17248,
"project_id": 11979,
"name": "Short",
"count": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z"
}
]
}
]
},
{
"id": 55920,
"project_id": 11979,
"name": "Plant",
"color": "#46ccb2",
"count": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z",
"attribute_groups": []
},
{
"id": 55921,
"project_id": 11979,
"type": "tag",
"name": "Tag_Class",
"color": "#46ccb2",
"count": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z",
"attribute_groups": []
},
{
"id": 55923,
"project_id": 11979,
"type": "tag",
"name": "Tag_Class_2",
"color": "#46ccb2",
"count": 0,
"createdAt": "2020-10-12T11:35:20.000Z",
"updatedAt": "2020-10-12T11:35:20.000Z",
"attribute_groups": []
}
]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading