class_docstr: The schema for predictions or labels when doing classification, object detection, keypoint detection or instance segmentation 
class_docstr_tok: ["The","schema","for","predictions","or","labels","when","doing","classification",",","object","detection",",","keypoint","detection","or","instance","segmentation"]
docstr: Create an instance of PredictionTaskSchemaBase from a dict
docstr_tok: ["Create","an","instance","of","PredictionTaskSchemaBase","from","a","dict"]
code: def from_dict(
      cls, obj: dict
  ) -> Union(PredictionTaskSchemaKeypoint, PredictionTaskSchemaSimple):
      """Create an instance of PredictionTaskSchemaBase 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(
              "PredictionTaskSchemaBase 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_task_schema_base.py
imports: from __future__ import annotations
  import pprint
  import re
  import json
  import lightly.openapi_generated.swagger_client.models
  from pydantic import Extra, BaseModel, Field, StrictStr, constr, validator
label_desc: Use image node_id 7 for calling the PredictionTaskSchemaBase obj's underlying member method code with example usage: obj.from_dict(cls, obj) and returns: klass