Skip to content
Snippets Groups Projects
Commit daf6aa30 authored by Mathieu Beligon's avatar Mathieu Beligon
Browse files

[common] (debug) Add detected objects to debug

parent a98b4b07
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ from polystar.common.pipeline.pipeline import Pipeline
@dataclass
class DebugInfo:
detected_objects: List[Object] = field(init=False)
validated_objects: List[Object] = field(init=False)
selected_object: Object = field(init=False)
target: TargetABC = field(init=False)
......@@ -36,3 +37,8 @@ class DebugPipeline(Pipeline):
objects = super()._get_objects_of_interest(image)
self.debug_info_.validated_objects = objects
return objects
def _detect_all_objects(self, image) -> List[Object]:
objects = super()._detect_all_objects(image)
self.debug_info_.detected_objects = objects
return objects
......@@ -35,7 +35,7 @@ class Pipeline:
return selected_object
def _get_objects_of_interest(self, image: np.ndarray) -> List[Object]:
objects = self.objects_detector.detect(image)
objects = self._detect_all_objects(image)
for objects_validator in self.objects_validators:
objects = objects_validator.filter(objects, image)
......@@ -43,3 +43,6 @@ class Pipeline:
raise NoTargetFound()
return objects
def _detect_all_objects(self, image) -> List[Object]:
return self.objects_detector.detect(image)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment