Merge branch 'main' into steve/changes_to_solo_spec
This commit is contained in:
Коммит
a56cab79c5
|
@ -1,4 +1,5 @@
|
||||||
import glob
|
import glob
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
@ -11,6 +12,8 @@ from pysolotools.core.models import (
|
||||||
SemanticSegmentationAnnotation,
|
SemanticSegmentationAnnotation,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class FramesIterator:
|
class FramesIterator:
|
||||||
SENSORS = [
|
SENSORS = [
|
||||||
|
@ -49,7 +52,7 @@ class FramesIterator:
|
||||||
self.frame_idx = start
|
self.frame_idx = start
|
||||||
pre = time.time()
|
pre = time.time()
|
||||||
self.metadata = metadata
|
self.metadata = metadata
|
||||||
print("DONE (t={:0.5f}s)".format(time.time() - pre))
|
logger.info("DONE (t={:0.5f}s)".format(time.time() - pre))
|
||||||
|
|
||||||
self.total_frames = self.metadata.totalFrames
|
self.total_frames = self.metadata.totalFrames
|
||||||
self.total_sequences = self.metadata.totalSequences
|
self.total_sequences = self.metadata.totalSequences
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import logging
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
|
@ -16,6 +17,8 @@ from pysolotools.core import (
|
||||||
from pysolotools.core.iterators import FramesIterator
|
from pysolotools.core.iterators import FramesIterator
|
||||||
from pysolotools.core.models import DatasetAnnotations, DatasetMetadata
|
from pysolotools.core.models import DatasetAnnotations, DatasetMetadata
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class FrameIteratorTest:
|
class FrameIteratorTest:
|
||||||
|
@ -51,7 +54,9 @@ class TestFramesIterator:
|
||||||
lambda k: isinstance(k, RGBCameraCapture),
|
lambda k: isinstance(k, RGBCameraCapture),
|
||||||
setup_frame_iterator.frame.captures,
|
setup_frame_iterator.frame.captures,
|
||||||
)
|
)
|
||||||
print(f"\n \n Testing with {len(list(rgb_captures))} RGBCameraCapture \n \n ")
|
logger.debug(
|
||||||
|
f"\n \n Testing with {len(list(rgb_captures))} RGBCameraCapture \n \n "
|
||||||
|
)
|
||||||
for capture in rgb_captures:
|
for capture in rgb_captures:
|
||||||
assert isinstance(capture, RGBCameraCapture)
|
assert isinstance(capture, RGBCameraCapture)
|
||||||
|
|
||||||
|
@ -66,7 +71,7 @@ class TestFramesIterator:
|
||||||
bbox2dannotations = filter(
|
bbox2dannotations = filter(
|
||||||
lambda c: isinstance(c, BoundingBox2DAnnotation), annotations
|
lambda c: isinstance(c, BoundingBox2DAnnotation), annotations
|
||||||
)
|
)
|
||||||
print(
|
logger.debug(
|
||||||
f"\n \n Testing with {len(list(bbox2dannotations))} BoundingBox2DAnnotation \n \n "
|
f"\n \n Testing with {len(list(bbox2dannotations))} BoundingBox2DAnnotation \n \n "
|
||||||
)
|
)
|
||||||
for bbox2d in bbox2dannotations:
|
for bbox2d in bbox2dannotations:
|
||||||
|
@ -75,7 +80,7 @@ class TestFramesIterator:
|
||||||
bbox3dannotations = filter(
|
bbox3dannotations = filter(
|
||||||
lambda c: isinstance(c, BoundingBox3DAnnotation), annotations
|
lambda c: isinstance(c, BoundingBox3DAnnotation), annotations
|
||||||
)
|
)
|
||||||
print(
|
logger.debug(
|
||||||
f"\n \n Testing with {len(list(bbox3dannotations))} BoundingBox3DAnnotation \n \n "
|
f"\n \n Testing with {len(list(bbox3dannotations))} BoundingBox3DAnnotation \n \n "
|
||||||
)
|
)
|
||||||
for bbox3d in bbox3dannotations:
|
for bbox3d in bbox3dannotations:
|
||||||
|
@ -84,7 +89,7 @@ class TestFramesIterator:
|
||||||
instance_segmentation_annotations = filter(
|
instance_segmentation_annotations = filter(
|
||||||
lambda c: isinstance(c, InstanceSegmentationAnnotation), annotations
|
lambda c: isinstance(c, InstanceSegmentationAnnotation), annotations
|
||||||
)
|
)
|
||||||
print(
|
logger.debug(
|
||||||
f"\n \n Testing with {len(list(instance_segmentation_annotations))} "
|
f"\n \n Testing with {len(list(instance_segmentation_annotations))} "
|
||||||
f"InstanceSegmentationAnnotation \n \n "
|
f"InstanceSegmentationAnnotation \n \n "
|
||||||
)
|
)
|
||||||
|
@ -96,7 +101,7 @@ class TestFramesIterator:
|
||||||
semantic_segmentation_annotations = filter(
|
semantic_segmentation_annotations = filter(
|
||||||
lambda c: isinstance(c, SemanticSegmentationAnnotation), annotations
|
lambda c: isinstance(c, SemanticSegmentationAnnotation), annotations
|
||||||
)
|
)
|
||||||
print(
|
logger.debug(
|
||||||
f"\n \n Testing with {len(list(semantic_segmentation_annotations))} "
|
f"\n \n Testing with {len(list(semantic_segmentation_annotations))} "
|
||||||
f"SemanticSegmentationAnnotation \n \n "
|
f"SemanticSegmentationAnnotation \n \n "
|
||||||
)
|
)
|
||||||
|
@ -108,7 +113,7 @@ class TestFramesIterator:
|
||||||
keypoint_annotations = filter(
|
keypoint_annotations = filter(
|
||||||
lambda c: isinstance(c, KeypointAnnotation), annotations
|
lambda c: isinstance(c, KeypointAnnotation), annotations
|
||||||
)
|
)
|
||||||
print(
|
logger.debug(
|
||||||
f"\n \n Testing with {len(list(keypoint_annotations))} "
|
f"\n \n Testing with {len(list(keypoint_annotations))} "
|
||||||
f"SemanticSegmentationAnnotation \n \n "
|
f"SemanticSegmentationAnnotation \n \n "
|
||||||
)
|
)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче