def req_channel_type():
    hfl_chnl_proto_obj.required_devicesData = True
    payload = hfl_chnl_proto_obj.SerializeToString()
    # print "payload :: ", payload
    hfl_publ_obj.send(payload)

    ecal.finalize()
Esempio n. 2
0
def req_image_data():
    hfl_chnl_proto_obj.isReady = True
    payload = hfl_chnl_proto_obj.SerializeToString()
    # print "payload :: ", payload
    hfl_publ_obj.send(payload)

    ecal.finalize()
Esempio n. 3
0
def req_timestamp():
    dvc_data_proto_obj = common_pb2.DevicesDataRequest()
    dvc_data_proto_obj.requiredDevicesData = True
    payload = dvc_data_proto_obj.SerializeToString()
    # print "payload :: ", payload
    tmstamp_publ_obj.send(payload)

    ecal.finalize()
def req_image_data():
    hfl_req_proto_obj.required_timestamp = 1524659296562401
    hfl_req_proto_obj.request_channel_name = 'svu32x_rear'
    hfl_req_proto_obj.request_device_name = 'svu32'
    payload = hfl_req_proto_obj.SerializeToString()
    # print "payload :: ", payload
    hfl_publ_obj.send(payload)

    ecal.finalize()
Esempio n. 5
0
def request_hfl_data():

    # while ecal.ok():
    # hfl_req_proto_obj.required_timestamp = 1504816617728550
    hfl_req_proto_obj.image_index = 8   #1504816617788522
    # hfl_req_proto_obj.hfl_file_name = "D:\\Work\\2018\\code\\LT5G\\HDF5_reader\\2017.09.07_at_20.37.57_camera-mi_1449.h5"

    hfl_publ_obj.send(hfl_req_proto_obj.SerializeToString())

    ecal.finalize()
Esempio n. 6
0
def req_pcl_points():
    pcl_data_proto_obj = common_pb2.DataRequest()
    pcl_data_proto_obj.requiredTimestamp = 1521225338975243 #1521225351544589
    pcl_data_proto_obj.requestDeviceName = "HFL"
    pcl_data_proto_obj.requestChannelName = "Valodyne"
    pcl_data_proto_obj.uniqueId = 1
    payload = pcl_data_proto_obj.SerializeToString()
    # print "payload :: ", payload
    pcl_publ_obj.send(payload)

    ecal.finalize()
        r = results[0]
        ed_time = datetime.now()
        duration = ed_time - st_time
        print("detection done in ... ", duration)
        # If visualization flag is set to True in topics.json file it would pop an
        # image with masks, object classes
        if vis_flag:
            show_detected_img(re_img_np_ary, r['rois'], r['class_ids'],
                              r['masks'])

        # Arrange the detected output in a dictionary
        # key: tuple having co-ordinates of BBox
        # value: tuple, 1st value is class id, 2nd value is a mask of numpy array
        rois_tupl_conv_lst = [tuple(ech_roi) for ech_roi in r['rois'].tolist()]
        N = r['rois'].shape[0]
        # print("N :: ", N)
        mask_obj_lst = []
        for i in range(N):
            mask = r['masks'][:, :, i]
            # print("mask >> ", type(mask))
            mask_obj_lst.append(mask)
        # detected_dict = dict(zip(rois_tupl_conv_lst, r['class_ids'].tolist()))
        clsid_mask_tupl = zip(r['class_ids'].tolist(), mask_obj_lst)
        detected_dict = dict(zip(rois_tupl_conv_lst, clsid_mask_tupl))
        # Publish the class name, bounding box coordinates and the mask numpy array
        # over prototobuf layer
        publish_rois(detected_dict)
        print("published response", datetime.now())

ecal.finalize()