Пример #1
0
    def get_result0(self, img0):
        try:
            ret = []
            tlwhs, ids = inference(self.tracker0, img0)
            vis_im = plot_tracking(img0, tlwhs, ids)
            current = time.time()
            cv2.imwrite('./debug/0/' + str(int(current * 10000000)) + '.png',
                        vis_im)

            if len(tlwhs) == 0:
                return ret
            for label, det in zip(ids, tlwhs):
                ret.append(label)
                ret.append(int(det[0]))
                ret.append(int(det[1]))
                ret.append(int(det[2]))
                ret.append(int(det[3]))
            print('get_result0', ret)
            return ret
        except Exception as e:
            print('***********')
            print(e)
            traceback.print_exc()
            print('***********')
            return ret
Пример #2
0
 def get_result2(self, img0):
     ret = []
     tlwhs, ids = inference(self.tracker2, img0)
     vis_im = plot_tracking(img0, tlwhs, ids)
     current = time.time()
     cv2.imwrite('./debug/2/' + str(int(current * 10000000)) + '.png',
                 vis_im)
     if len(tlwhs) == 0:
         return ret
     for label, det in zip(ids, tlwhs):
         ret.append(label)
         ret.append(int(det[0]))
         ret.append(int(det[1]))
         ret.append(int(det[2]))
         ret.append(int(det[3]))
     print('get_result2', ret)
     return ret
Пример #3
0
    def __call__(self, img0, img1, img2, img3):

        vis_im = plot_tracking(img, tlwhs, ids)

        return dict(im_dets=tlwhs, im_ids=ids)