How to use the nyoka.PMML44.Constant 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
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])