Esempio n. 1
0
    def test_gen_C(self):
        output = tests.read_from_output(lambda: tests.execute_file(self.gen_c_path))
        file_list = ["qumico.c", "qumico.so", "qumico.h", "qumico_type.h"]
        folder_list = [QUMICO_LIB, QUMICO_INCLUDE]

        self.assertTrue(tests.is_dir_contains(dirs=self.output_path, folder_list=folder_list, file_list=file_list))
        self.assertIn("Cソースを生成しました。出力先:", output)
Esempio n. 2
0
    def test_dataset_tool_instance_training_flag_true_data_label_different(
            self):
        result = tests.read_from_output(lambda: dataset_tool.DatasetTool(
            training_flag=True,
            data=self.dataset,
            label=numpy.array([1, 2, 3, 5, 6])))

        self.assertIn("学習データサイズが異なる, 入力データサイズ = 3 ラベルサイズ = 5", result)
Esempio n. 3
0
 def test_conv_test(self):
     output = tests.read_from_output(
         lambda: conv_test.conv_test(model=self.model,
                                     test_data=self.dataset_test,
                                     ckpt_file=self.ckpt_file,
                                     batch_size=1000))
     self.assertIn("Total", output)
     self.assertIn("Accuracy", output)
Esempio n. 4
0
    def test_vgg16_infer(self):
        vgg16_infer.classes = self.classes_test
        count_correct = 0
        for x in vgg16_infer.classes:
            vgg16_infer.img_file = os.path.join(self.input_path, (x + ".jpg"))
            output = tests.read_from_output(lambda: vgg16_infer.main())
            if x in output:
                count_correct += 1

        accuracy = count_correct / len(self.classes_test)
        self.assertGreaterEqual(accuracy, 0.7)
Esempio n. 5
0
    def test_gen_c(self):
        res = tests.read_from_output(
            lambda: tests.execute_file(self.gen_c_path))

        file_list = ["numpy.c", "qumico.c", "qumico.so"]
        folder_list = ["include", "initializers", "lib"]

        self.assertIn("Cソースを生成しました。出力先:", res)
        self.assertTrue(
            tests.is_dir_contains(self.output_path,
                                  file_list=file_list,
                                  folder_list=folder_list))
Esempio n. 6
0
    def test_conv_onnx(self):
        output = tests.read_from_output(
            lambda: tests.execute_file(self.module_path))

        folder_list = ["model"]
        file_list = ["tiny_yolo_v2_yad2k.onnx"]

        self.assertTrue(
            tests.is_dir_contains(dirs=self.current_path,
                                  folder_list=folder_list))
        self.assertTrue(
            tests.is_dir_contains(dirs=self.output_path, file_list=file_list))
        self.assertIn("tiny_yolo_v2_yad2k.onnxを作成しました。", output)
Esempio n. 7
0
    def test_infer_c(self):
        res = tests.read_from_output(lambda: mobilenet_infer_c.infer(image_path=self.image_input,
                                                                     so_lib_path=self.c_path))

        self.assertIn("tiger", res)
Esempio n. 8
0
 def test_infer_c(self):
     output = tests.read_from_output(
         lambda: tests.execute_file(self.module_file_dir))
     self.assertIn("sheep", output)
     self.assertIn("person", output)
     self.assertIn("cow", output)
Esempio n. 9
0
    def test_vgg16_to_onnx(self):
        output = tests.read_from_output(lambda: tests.execute_file(self.vgg16_to_onnx_path))

        self.assertTrue(tests.is_dir_contains(dirs=self.output_path, file_list=["vgg16.onnx"]))
        self.assertIn("onnx/vgg16.onnxを作成しました。", output)
Esempio n. 10
0
    def test_infer(self):
        res = tests.read_from_output(lambda: mobilenet_infer.infer(
            tflite_model_path=self.tflite_input, image_path=self.image_input))

        self.assertIn("tiger", res)
Esempio n. 11
0
 def test_vgg16_test(self):
     output = tests.read_from_output(lambda: self.vgg_test_instance.main())
     self.assertIn("image : ", output)
     self.assertIn("1", output)
Esempio n. 12
0
    def test_infer(self):
        res = tests.read_from_output(lambda: automl_infer.infer(tflite_model_path=self.tflite_input,
                                                                   image_path=self.image_input))

        self.assertIn("dog", res)
Esempio n. 13
0
    def test_infer_c(self):
        res = tests.read_from_output(lambda: automl_infer_c.infer(
            image_path=self.image_input, so_lib_path=self.c_path))

        self.assertIn("dog", res)