class_docstr: PredictionSingletonBase
class_docstr_tok: ["PredictionSingletonBase"]
docstr: Create an instance of PredictionSingletonBase from a dict
docstr_tok: ["Create","an","instance","of","PredictionSingletonBase","from","a","dict"]
code: def from_dict(
      cls, obj: dict
  ) -> Union(
      PredictionSingletonClassification,
      PredictionSingletonInstanceSegmentation,
      PredictionSingletonKeypointDetection,
      PredictionSingletonObjectDetection,
      PredictionSingletonSemanticSegmentation,
  ):
      """Create an instance of PredictionSingletonBase from a dict"""
      # look up the object type based on discriminator mapping
      object_type = cls.get_discriminator_value(obj)
      if object_type:
          klass = getattr(
              lightly.openapi_generated.swagger_client.models,
              object_type,
          )
          return klass.from_dict(obj)
      else:
          raise ValueError(
              "PredictionSingletonBase failed to lookup discriminator value from "
              + json.dumps(obj)
              + ". Discriminator property name: "
              + cls.__discriminator_property_name
              + ", mapping: "
              + json.dumps(cls.__discriminator_value_class_map)
          )
  
file_path: lightly/lightly/openapi_generated/swagger_client/models/prediction_singleton_base.py
imports: from __future__ import annotations
  import pprint
  import re
  import json
  import lightly.openapi_generated.swagger_client.models
  from typing import Optional, Union
  from pydantic import Extra, BaseModel, Field, StrictStr, confloat, conint, constr, validator
label_desc: Use image node_id 9 for calling the PredictionSingletonBase obj's underlying member method code with example usage: obj.from_dict(cls, obj) and returns: klass