Commit 4401bfc8 authored by Sikhin VC's avatar Sikhin VC

added engine file

parent 25d88539
Pipeline #68933 canceled with stage
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -238,10 +238,14 @@ class CementBagCounter(ModelWrapper): ...@@ -238,10 +238,14 @@ class CementBagCounter(ModelWrapper):
""" """
if not self.janus_metadata.get('metadata'): if not self.janus_metadata.get('metadata'):
self.janus_metadata['metadata'] = EDGE_CONFIG["extra_fields"] self.janus_metadata['metadata'] = EDGE_CONFIG["extra_fields"]
_coordinates = []
_coordinates = [self.janus_metadata['metadata'].get(coordinate_key) for coordinate_key in for data in self.janus_metadata["metadata"]:
JanusDeploymentConstants.LINE_COORDINATES] print("data", data)
_alignment = self.janus_metadata['metadata'].get(JanusDeploymentConstants.ALIGNMENT_KEY) for elem in data:
if data[elem] in JanusDeploymentConstants.LINE_COORDINATES:
_coordinates.append(data["value"])
if data[elem] == JanusDeploymentConstants.ALIGNMENT_KEY:
_alignment = data["value"]
return _alignment, _coordinates return _alignment, _coordinates
...@@ -546,13 +550,13 @@ class CementBagCounter(ModelWrapper): ...@@ -546,13 +550,13 @@ class CementBagCounter(ModelWrapper):
def _predict(self, obj): def _predict(self, obj):
try: try:
frame = obj['frame'] frame = obj['frame']
logger.info(f"Frame Received with shape {frame.shape}") # logger.info(f"Frame Received with shape {frame.shape}")
dets, frame, _dets, class_name = self.inference(frame) # dets, frame, _dets, class_name = self.inference(frame)
if len(dets) > 0: # if len(dets) > 0:
frame, objects, boxs = self.kalman_tracker(dets, frame) # frame, objects, boxs = self.kalman_tracker(dets, frame)
frame = self.update_bag_count(frame=frame, detection_objects=objects, class_name=class_name, # frame = self.update_bag_count(frame=frame, detection_objects=objects, class_name=class_name,
detections=_dets) # detections=_dets)
logger.debug("self.uncounted_objects --> {}".format(self.uncounted_objects)) # logger.debug("self.uncounted_objects --> {}".format(self.uncounted_objects))
frame = self.draw_line_over_image(frame) frame = self.draw_line_over_image(frame)
obj['frame'] = cv2.resize(frame, (self.config.get('FRAME_WIDTH'), self.config. obj['frame'] = cv2.resize(frame, (self.config.get('FRAME_WIDTH'), self.config.
get('FRAME_HEIGHT'))) get('FRAME_HEIGHT')))
......
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