Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Resolve bug when uploading to projects in CVAT #1926

Merged
merged 1 commit into from
Jul 6, 2022
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
2 changes: 1 addition & 1 deletion fiftyone/utils/cvat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4742,7 +4742,7 @@ def _has_ignored_attributes(self, label_schema):
_,
occluded_attr_name,
group_id_attr_name,
) = self._to_cvat_attributes(label_info["attributes"])
) = self._to_cvat_attributes(label_info.get("attributes", {}))

if occluded_attr_name or group_id_attr_name:
return True
Expand Down
23 changes: 22 additions & 1 deletion tests/intensive/cvat_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,20 @@ def test_project(self):
api = results.connect_to_api()
project_id = api.get_project_id(project_name)
self.assertIsNotNone(project_id)
self.assertIn(project_id, results.project_ids)
if project_id not in results.project_ids:
# Delete project if it exists
api.delete_project(project_id)
anno_key_retry = "anno_key_retry"
results = dataset.annotate(
anno_key_retry,
backend="cvat",
label_field="ground_truth",
project_name=project_name,
)
api = results.connect_to_api()
project_id = api.get_project_id(project_name)
self.assertIsNotNone(project_id)
self.assertIn(project_id, results.project_ids)

anno_key2 = "anno_key2"
results2 = dataset.annotate(
Expand All @@ -480,6 +493,14 @@ def test_project(self):
self.assertNotIn(project_id, results2.project_ids)
self.assertIsNotNone(api.get_project_id(project_name))

# Test upload without schema
anno_key3 = "anno_key3"
results3 = dataset.annotate(
anno_key3,
backend="cvat",
project_name=project_name,
)

with self.assertRaises(ValueError):
label_schema = {
"ground_truth": {
Expand Down