def detection(self):
    global logger
    if self.__visiual:
        imgs = os.listdir(self.__visiual)
        logger.info('***********Start Detection****************')
        for v in imgs:
            path = os.path.join(self.__visiual, v)
            logger.info('val images : {}'.format(path))
            img = cv2.imread(path)
            assert (img is not None)
            bboxes_prd = self.__evalter.get_bbox(img, v)
            if (bboxes_prd.shape[0] != 0):
                boxes = bboxes_prd[..., :4]
                class_inds = bboxes_prd[(..., 5)].astype(np.int32)
                scores = bboxes_prd[(..., 4)]
                visualize_boxes(image=img, boxes=boxes, labels=class_inds, probs=scores, class_labels=self.__classes)
                path = os.path.join(cfg.PROJECT_PATH, 'detection_result/{}'.format(v))
                cv2.imwrite(path, img)
                logger.info('saved images : {}'.format(path))
def detection(self):
    global logger
    if self.__visiual:
        imgs = os.listdir(self.__visiual)
        logger.info('***********Start Detection****************')
        for v in imgs:
            path = os.path.join(self.__visiual, v)
            logger.info('val images : {}'.format(path))
            img = cv2.imread(path)
            assert (img is not None)
            bboxes_prd = self.__evalter.get_bbox(img, v)
            if (bboxes_prd.shape[0] != 0):
                boxes = bboxes_prd[..., :4]
                class_inds = bboxes_prd[(..., 5)].astype(np.int32)
                scores = bboxes_prd[(..., 4)]
                visualize_boxes(image=img, boxes=boxes, labels=class_inds, probs=scores, class_labels=self.__classes)
                path = os.path.join(cfg.PROJECT_PATH, 'detection_result/{}'.format(v))
                cv2.imwrite(path, img)
                logger.info('saved images : {}'.format(path))