Commit 17e20dbe authored by Sikhin VC's avatar Sikhin VC

added engine file

parent 1cbfbff2
Pipeline #68975 canceled with stage
...@@ -240,7 +240,6 @@ class CementBagCounter(ModelWrapper): ...@@ -240,7 +240,6 @@ class CementBagCounter(ModelWrapper):
self.janus_metadata['metadata'] = EDGE_CONFIG["extra_fields"] self.janus_metadata['metadata'] = EDGE_CONFIG["extra_fields"]
_coordinates = [] _coordinates = []
for data in self.janus_metadata["metadata"]: for data in self.janus_metadata["metadata"]:
print("data", data)
for elem in data: for elem in data:
if data[elem] in JanusDeploymentConstants.LINE_COORDINATES: if data[elem] in JanusDeploymentConstants.LINE_COORDINATES:
_coordinates.append(data["value"]) _coordinates.append(data["value"])
...@@ -256,6 +255,7 @@ class CementBagCounter(ModelWrapper): ...@@ -256,6 +255,7 @@ class CementBagCounter(ModelWrapper):
:return: boolean :return: boolean
""" """
_alignment, line_coordinates = self.get_line_coordinates() _alignment, line_coordinates = self.get_line_coordinates()
logger.info(f"line_coordinates {line_coordinates} and _alignment {_alignment}")
assert len(line_coordinates) == 4, "Line coordinates variable is invalid" assert len(line_coordinates) == 4, "Line coordinates variable is invalid"
assert len(point) == 2, "Point variable is invalid" assert len(point) == 2, "Point variable is invalid"
...@@ -394,7 +394,7 @@ class CementBagCounter(ModelWrapper): ...@@ -394,7 +394,7 @@ class CementBagCounter(ModelWrapper):
frame = draw_circles_on_frame( frame = draw_circles_on_frame(
frame, centroid, radius=10, color=(0, 0, 255), thickness=-1 frame, centroid, radius=10, color=(0, 0, 255), thickness=-1
) )
logger.info(f'self.validate_point_position(centroid){self.validate_point_position(centroid)}') logger.info(f'self.validate_point_position(centroid) {self.validate_point_position(centroid)}')
if self.validate_point_position(centroid): if self.validate_point_position(centroid):
if not isinstance(self.initial_object_position, bool): if not isinstance(self.initial_object_position, bool):
...@@ -403,7 +403,7 @@ class CementBagCounter(ModelWrapper): ...@@ -403,7 +403,7 @@ class CementBagCounter(ModelWrapper):
self.initial_object_position = True self.initial_object_position = True
_point_position = self.line_point_position(point=centroid) _point_position = self.line_point_position(point=centroid)
logger.info(f'Centroid position{_point_position}') logger.info(f'Centroid position {_point_position}')
# Check point in the same side as the initial object # Check point in the same side as the initial object
if _point_position == self.initial_object_position: if _point_position == self.initial_object_position:
# Check the object is not already counted # Check the object is not already counted
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment