def from_json(cls, json_str: str) -> PredictionSingleton:
        """Returns the object represented by the json string"""
        instance = PredictionSingleton.construct()
        error_messages = []
        match = 0

        # use oneOf discriminator to lookup the data type
        _data_type = json.loads(json_str).get("type")
        if not _data_type:
            raise ValueError("Failed to lookup data type from the field `type` in the input.")

        # check if data type is `PredictionSingletonClassification`
        if _data_type == "CLASSIFICATION":
            instance.actual_instance = PredictionSingletonClassification.from_json(json_str)
            return instance

        # check if data type is `PredictionSingletonInstanceSegmentation`
        if _data_type == "INSTANCE_SEGMENTATION":
            instance.actual_instance = PredictionSingletonInstanceSegmentation.from_json(json_str)
            return instance

        # check if data type is `PredictionSingletonKeypointDetection`
        if _data_type == "KEYPOINT_DETECTION":
            instance.actual_instance = PredictionSingletonKeypointDetection.from_json(json_str)
            return instance

        # check if data type is `PredictionSingletonObjectDetection`
        if _data_type == "OBJECT_DETECTION":
            instance.actual_instance = PredictionSingletonObjectDetection.from_json(json_str)
            return instance

        # check if data type is `PredictionSingletonClassification`
        if _data_type == "PredictionSingletonClassification":
            instance.actual_instance = PredictionSingletonClassification.from_json(json_str)
            return instance

        # check if data type is `PredictionSingletonInstanceSegmentation`
        if _data_type == "PredictionSingletonInstanceSegmentation":
            instance.actual_instance = PredictionSingletonInstanceSegmentation.from_json(json_str)
            return instance

        # check if data type is `PredictionSingletonKeypointDetection`
        if _data_type == "PredictionSingletonKeypointDetection":
            instance.actual_instance = PredictionSingletonKeypointDetection.from_json(json_str)
            return instance

        # check if data type is `PredictionSingletonObjectDetection`
        if _data_type == "PredictionSingletonObjectDetection":
            instance.actual_instance = PredictionSingletonObjectDetection.from_json(json_str)
            return instance

        # check if data type is `PredictionSingletonSemanticSegmentation`
        if _data_type == "PredictionSingletonSemanticSegmentation":
            instance.actual_instance = PredictionSingletonSemanticSegmentation.from_json(json_str)
            return instance

        # check if data type is `PredictionSingletonSemanticSegmentation`
        if _data_type == "SEMANTIC_SEGMENTATION":
            instance.actual_instance = PredictionSingletonSemanticSegmentation.from_json(json_str)
            return instance

        # deserialize data into PredictionSingletonClassification
        try:
            instance.actual_instance = PredictionSingletonClassification.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into PredictionSingletonObjectDetection
        try:
            instance.actual_instance = PredictionSingletonObjectDetection.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into PredictionSingletonSemanticSegmentation
        try:
            instance.actual_instance = PredictionSingletonSemanticSegmentation.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into PredictionSingletonInstanceSegmentation
        try:
            instance.actual_instance = PredictionSingletonInstanceSegmentation.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into PredictionSingletonKeypointDetection
        try:
            instance.actual_instance = PredictionSingletonKeypointDetection.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))

        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when deserializing the JSON string into PredictionSingleton with oneOf schemas: PredictionSingletonClassification, PredictionSingletonInstanceSegmentation, PredictionSingletonKeypointDetection, PredictionSingletonObjectDetection, PredictionSingletonSemanticSegmentation. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when deserializing the JSON string into PredictionSingleton with oneOf schemas: PredictionSingletonClassification, PredictionSingletonInstanceSegmentation, PredictionSingletonKeypointDetection, PredictionSingletonObjectDetection, PredictionSingletonSemanticSegmentation. Details: " + ", ".join(error_messages))
        else:
            return instance
Returns the object represented by the json string
lightly/openapi_generated/swagger_client/models/prediction_singleton.py