Skip to content

Commit 8c4cf24

Browse files
committed
round frames count in VideoFrameGenerator
1 parent b7e0c4d commit 8c4cf24

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/superannotate/lib/core/video_convertor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, annotation_data: dict, fps: int):
4242
self.fps = fps
4343
self.ratio = 1000 * 1000 / fps
4444
self._frame_id = 1
45-
self.frames_count = self.duration * fps
45+
self.frames_count = int(self.duration * fps)
4646
self.annotations: dict = {}
4747
self._mapping = {}
4848
self._process()

tests/integration/annotations/test_uopload_annotations_without_classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_annotation_upload(self):
3737
with tempfile.TemporaryDirectory() as classes_dir:
3838
classes_path = sa.download_annotation_classes_json(self.PROJECT_NAME, classes_dir)
3939
self.assertEqual(json.load(open(classes_path, "r")), [])
40-
sa.create_annotation_class(self.PROJECT_NAME, "tt", "#FFFFFF", type="tag")
40+
sa.create_annotation_class(self.PROJECT_NAME, "tt", "#FFFFFF", class_type="tag")
4141
classes_path = sa.download_annotation_classes_json(self.PROJECT_NAME, classes_dir)
4242
classes_json = json.load(open(classes_path, "r"))
4343
self.assertEqual(classes_json[0]["type"], "tag")

tests/integration/classes/test_create_annotation_class.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def large_json_path(self):
1919
return os.path.join(DATA_SET_PATH, self.TEST_LARGE_CLASSES_JSON)
2020

2121
def test_create_annotation_class(self):
22-
sa.create_annotation_class(self.PROJECT_NAME, "test_add", "#FF0000", type="tag")
22+
sa.create_annotation_class(self.PROJECT_NAME, "test_add", "#FF0000", class_type="tag")
2323
classes = sa.search_annotation_classes(self.PROJECT_NAME)
2424
self.assertEqual(classes[0]["type"], "tag")
2525

@@ -36,7 +36,7 @@ class TestCreateAnnotationClassNonVectorWithError(BaseTestCase):
3636
def test_create_annotation_class(self):
3737
msg = ""
3838
try:
39-
sa.create_annotation_class(self.PROJECT_NAME, "test_add", "#FF0000", type="tag")
39+
sa.create_annotation_class(self.PROJECT_NAME, "test_add", "#FF0000", class_type="tag")
4040
except Exception as e:
4141
msg = str(e)
4242
self.assertEqual(msg, "Predefined tagging functionality is not supported for projects of type Video.")

tests/integration/test_depricated_functions_document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
class TestDeprecatedFunctionsDocument(TestCase):
15-
PROJECT_NAME = "document proj 11"
15+
PROJECT_NAME = "TestDeprecatedFunctionsDocument"
1616
PROJECT_DESCRIPTION = "desc"
1717
PROJECT_TYPE = "Document"
1818
PATH_TO_URLS = "data_set/attach_urls.csv"

tests/integration/test_depricated_functions_video.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
class TestDeprecatedFunctionsVideo(TestCase):
15-
PROJECT_NAME = "vid proj 11"
15+
PROJECT_NAME = "TestDeprecatedFunctionsVideo"
1616
PROJECT_DESCRIPTION = "desc"
1717
PROJECT_TYPE = "Video"
1818
PATH_TO_URLS = "data_set/attach_urls.csv"

tests/integration/test_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def test_get_project_metadata(self):
7373
metadata = sa.get_project_metadata(self.PROJECT_NAME)
7474
self.assertIsNotNone(metadata["id"])
7575
self.assertListEqual(metadata.get("contributors", []), [])
76-
sa.create_annotation_class(self.PROJECT_NAME, "tt", "#FFFFFF", type="tag")
76+
sa.create_annotation_class(self.PROJECT_NAME, "tt", "#FFFFFF", class_type="tag")
7777
metadata_with_users = sa.get_project_metadata(self.PROJECT_NAME, include_annotation_classes=True, include_contributors=True)
7878
self.assertEqual(metadata_with_users['classes'][0]['type'], 'tag')
7979
self.assertIsNotNone(metadata_with_users.get("contributors"))

0 commit comments

Comments
 (0)