Commit d47db010 authored by Sikhin VC's avatar Sikhin VC

added engine file

parent 1a7a0d4e
Pipeline #69091 canceled with stage
......@@ -20,6 +20,7 @@ from scripts.utils.tracker import Tracker
from scripts.utils.yolov5_trt import YoloV5TRT
from scipy.optimize import linear_sum_assignment as linear_assignment
from edge_engine.common.config import EDGE_CONFIG
import requests
class CementBagCounter(ModelWrapper):
......@@ -326,12 +327,14 @@ class CementBagCounter(ModelWrapper):
elif object_id in self.uncounted_objects:
self.uncounted_objects.pop(object_id, None)
self.count += 1
self.send_payload(
resize_to_64_64(frame=frame),
bag_type="cement_bag",
message="cement_bag",
count=self.count,
)
url = "http://192.168.2.228:2325/events/add_event"
img2 = frame.copy()
img2 = cv2.resize(img2, (64, 64))
bs64 = str(base64.b64encode(img2).decode('utf-8')) # Changed this line. converted byte to string
json = {"eventId": "123", "cameraId": "12", "cameraName": "12", "timestamp": "123", "frame": bs64}
response = requests.post(url=url, json=json)
logger.info(f"response is : {response.text}")
logger.info(f"Count: {self.count}")
frame = draw_circles_on_frame(
......
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