Пример #1
0
    def recognize(self, model):
        """从self.all_format_chunks中取出图片进行识别,需要传入模型路径。

        :param model str, 由sklearn生成的模型的路径
        :return 四个数字和一个运算符
        """

        result = []
        for each_img in self.all_format_chunks:
            x = Img.classify(each_img, model=model)
            result.append(x)
        if self.type == '11':
            result.insert(2, 0)
            result.insert(0, 0)
        elif self.type == '12':
            result.insert(0, 0)
        elif self.type == '21':
            result.insert(3, 0)
        else:
            pass
        return result  # x1, x2, symbol, x3, x4