How to use the nyoka.PMML44 function in nyoka

To help you get started, we’ve selected a few nyoka examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nyoka-pmml / nyoka / nyoka / object_detection / retinanet.py View on Github external
Returns
        -------
        Nyoka's LocalTransformations object
        """
        apply = pml.Apply(
            function='KerasRetinaNet:getBase64StringFromBufferedInput',
            FieldRef = [pml.FieldRef(field=self.input_format)],
            Constant = [pml.Constant(valueOf_='tf' if self.backbone_name in ['mobilenet', 'densenet'] else 'caffe')]
        )
        der_fld = pml.DerivedField(
            name="base64String",
            optype="categorical",
            dataType="string",
            Apply = apply
        )
        return pml.LocalTransformations(DerivedField = [der_fld])
github nyoka-pmml / nyoka / nyoka / object_detection / retinanet.py View on Github external
def get_output(self):
        """
        Generates Output for RetinaNet

        Returns
        -------
        Nyoka's Output object
        """
        out_flds = []
        out_flds.append(
            pml.OutputField(
                name="predicted_LabelBoxScore",
                dataType="string",
                feature="predictedValue",
                Extension = [pml.Extension(extender="ADAPA", name="format", value="JSON")]
            )
        )
        return pml.Output(OutputField=out_flds)
github nyoka-pmml / nyoka / nyoka / object_detection / retinanet.py View on Github external
def get_local_transformation(self):
        """
        Generates Trasformation information for RetinaNet

        Returns
        -------
        Nyoka's LocalTransformations object
        """
        apply = pml.Apply(
            function='KerasRetinaNet:getBase64StringFromBufferedInput',
            FieldRef = [pml.FieldRef(field=self.input_format)],
            Constant = [pml.Constant(valueOf_='tf' if self.backbone_name in ['mobilenet', 'densenet'] else 'caffe')]
        )
        der_fld = pml.DerivedField(
            name="base64String",
            optype="categorical",
            dataType="string",
            Apply = apply
        )
        return pml.LocalTransformations(DerivedField = [der_fld])
github nyoka-pmml / nyoka / nyoka / object_detection / retinanet.py View on Github external
def get_output(self):
        """
        Generates Output for RetinaNet

        Returns
        -------
        Nyoka's Output object
        """
        out_flds = []
        out_flds.append(
            pml.OutputField(
                name="predicted_LabelBoxScore",
                dataType="string",
                feature="predictedValue",
                Extension = [pml.Extension(extender="ADAPA", name="format", value="JSON")]
            )
        )
        return pml.Output(OutputField=out_flds)
github nyoka-pmml / nyoka / nyoka / object_detection / retinanet.py View on Github external
def get_local_transformation(self):
        """
        Generates Trasformation information for RetinaNet

        Returns
        -------
        Nyoka's LocalTransformations object
        """
        apply = pml.Apply(
            function='KerasRetinaNet:getBase64StringFromBufferedInput',
            FieldRef = [pml.FieldRef(field=self.input_format)],
            Constant = [pml.Constant(valueOf_='tf' if self.backbone_name in ['mobilenet', 'densenet'] else 'caffe')]
        )
        der_fld = pml.DerivedField(
            name="base64String",
            optype="categorical",
            dataType="string",
            Apply = apply
        )
        return pml.LocalTransformations(DerivedField = [der_fld])
github nyoka-pmml / nyoka / nyoka / object_detection / retinanet.py View on Github external
def get_training_parameter(self):
        """
        Generates TrainingParameters for RetinaNet

        Returns
        -------
        Nyoka's TrainingParameters object
        """
        train_param = pml.TrainingParameters(architectureName='retinanet')
        return train_param
github nyoka-pmml / nyoka / nyoka / reconstruct / pmml_to_keras_model.py View on Github external
def __init__(self, pmml):
        self.nyoka_pmml = ny.parse(pmml,True)
        self.image_input = None
        self.layer_input = None
        self.model = None
        self.layers_outputs = {}
        self.model = self._build_model()