예제 #1
0
    def test_infer(self):

        label_path = os.path.join(self.label_list_path, "test.xml")
        origin = self.annotation_dataset_tool.get_annotation_label(full_path=label_path,
                                                                   label_file_type="voc_xml",
                                                                   resize_rate_h=1,
                                                                   resize_rate_w=1)

        output = tiny_yolo2_infer.infer(model=self.model,
                                        infer_data=self.annotation_dataset_tool,
                                        ckpt_file=self.ckpt_file,
                                        classes=self.classes,
                                        batch_size=self.batch_size,
                                        to_draw=False)

        iou_val = self._get_average_iuo_value(self._generate_boxes(origin), self._generate_boxes(output))
        self.assertGreaterEqual(iou_val, 0.6)
예제 #2
0
 def test_infer_no_classes(self):
     self.assertRaises(TypeError, lambda: tiny_yolo2_infer.infer(model=self.model,
                                                                 infer_data=self.annotation_dataset_tool,
                                                                 ckpt_file=self.ckpt_file,
                                                                 classes=None,
                                                                 batch_size=self.batch_size))
예제 #3
0
 def test_infer_no_infer_data(self):
     self.assertRaises(AttributeError, lambda: tiny_yolo2_infer.infer(model=None,
                                                                      infer_data=None,
                                                                      ckpt_file=None,
                                                                      classes=None,
                                                                      batch_size=None))