Skip to content

System Config Machine Learning Dto

immichpy.client.generated.models.system_config_machine_learning_dto.SystemConfigMachineLearningDto pydantic-model

Bases: BaseModel

SystemConfigMachineLearningDto

Show JSON schema:
{
  "$defs": {
    "CLIPConfig": {
      "description": "CLIPConfig",
      "properties": {
        "enabled": {
          "description": "Whether the task is enabled",
          "title": "Enabled",
          "type": "boolean"
        },
        "modelName": {
          "description": "Name of the model to use",
          "title": "Modelname",
          "type": "string"
        }
      },
      "required": [
        "enabled",
        "modelName"
      ],
      "title": "CLIPConfig",
      "type": "object"
    },
    "DuplicateDetectionConfig": {
      "description": "DuplicateDetectionConfig",
      "properties": {
        "enabled": {
          "description": "Whether the task is enabled",
          "title": "Enabled",
          "type": "boolean"
        },
        "maxDistance": {
          "anyOf": [
            {
              "maximum": 0.1,
              "minimum": 0.001,
              "type": "number"
            },
            {
              "maximum": 0,
              "minimum": 1,
              "type": "integer"
            }
          ],
          "description": "Maximum distance threshold for duplicate detection",
          "title": "Maxdistance"
        }
      },
      "required": [
        "enabled",
        "maxDistance"
      ],
      "title": "DuplicateDetectionConfig",
      "type": "object"
    },
    "FacialRecognitionConfig": {
      "description": "FacialRecognitionConfig",
      "properties": {
        "enabled": {
          "description": "Whether the task is enabled",
          "title": "Enabled",
          "type": "boolean"
        },
        "maxDistance": {
          "anyOf": [
            {
              "maximum": 2,
              "minimum": 0.1,
              "type": "number"
            },
            {
              "maximum": 2,
              "minimum": 1,
              "type": "integer"
            }
          ],
          "description": "Maximum distance threshold for face recognition",
          "title": "Maxdistance"
        },
        "minFaces": {
          "description": "Minimum number of faces required for recognition",
          "minimum": 1,
          "title": "Minfaces",
          "type": "integer"
        },
        "minScore": {
          "anyOf": [
            {
              "maximum": 1,
              "minimum": 0.1,
              "type": "number"
            },
            {
              "maximum": 1,
              "minimum": 1,
              "type": "integer"
            }
          ],
          "description": "Minimum confidence score for face detection",
          "title": "Minscore"
        },
        "modelName": {
          "description": "Name of the model to use",
          "title": "Modelname",
          "type": "string"
        }
      },
      "required": [
        "enabled",
        "maxDistance",
        "minFaces",
        "minScore",
        "modelName"
      ],
      "title": "FacialRecognitionConfig",
      "type": "object"
    },
    "MachineLearningAvailabilityChecksDto": {
      "description": "MachineLearningAvailabilityChecksDto",
      "properties": {
        "enabled": {
          "description": "Enabled",
          "title": "Enabled",
          "type": "boolean"
        },
        "interval": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            }
          ],
          "title": "Interval"
        },
        "timeout": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "integer"
            }
          ],
          "title": "Timeout"
        }
      },
      "required": [
        "enabled",
        "interval",
        "timeout"
      ],
      "title": "MachineLearningAvailabilityChecksDto",
      "type": "object"
    },
    "OcrConfig": {
      "description": "OcrConfig",
      "properties": {
        "enabled": {
          "description": "Whether the task is enabled",
          "title": "Enabled",
          "type": "boolean"
        },
        "maxResolution": {
          "description": "Maximum resolution for OCR processing",
          "minimum": 1,
          "title": "Maxresolution",
          "type": "integer"
        },
        "minDetectionScore": {
          "anyOf": [
            {
              "maximum": 1,
              "minimum": 0.1,
              "type": "number"
            },
            {
              "maximum": 1,
              "minimum": 1,
              "type": "integer"
            }
          ],
          "description": "Minimum confidence score for text detection",
          "title": "Mindetectionscore"
        },
        "minRecognitionScore": {
          "anyOf": [
            {
              "maximum": 1,
              "minimum": 0.1,
              "type": "number"
            },
            {
              "maximum": 1,
              "minimum": 1,
              "type": "integer"
            }
          ],
          "description": "Minimum confidence score for text recognition",
          "title": "Minrecognitionscore"
        },
        "modelName": {
          "description": "Name of the model to use",
          "title": "Modelname",
          "type": "string"
        }
      },
      "required": [
        "enabled",
        "maxResolution",
        "minDetectionScore",
        "minRecognitionScore",
        "modelName"
      ],
      "title": "OcrConfig",
      "type": "object"
    }
  },
  "description": "SystemConfigMachineLearningDto",
  "properties": {
    "availabilityChecks": {
      "$ref": "#/$defs/MachineLearningAvailabilityChecksDto"
    },
    "clip": {
      "$ref": "#/$defs/CLIPConfig"
    },
    "duplicateDetection": {
      "$ref": "#/$defs/DuplicateDetectionConfig"
    },
    "enabled": {
      "description": "Enabled",
      "title": "Enabled",
      "type": "boolean"
    },
    "facialRecognition": {
      "$ref": "#/$defs/FacialRecognitionConfig"
    },
    "ocr": {
      "$ref": "#/$defs/OcrConfig"
    },
    "urls": {
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "title": "Urls",
      "type": "array"
    }
  },
  "required": [
    "availabilityChecks",
    "clip",
    "duplicateDetection",
    "enabled",
    "facialRecognition",
    "ocr",
    "urls"
  ],
  "title": "SystemConfigMachineLearningDto",
  "type": "object"
}

Config:

  • populate_by_name: True
  • validate_assignment: True
  • protected_namespaces: ()

Fields:

enabled pydantic-field

enabled: StrictBool

Enabled

from_dict classmethod

from_dict(obj: Optional[Dict[str, Any]]) -> Optional[Self]

Create an instance of SystemConfigMachineLearningDto from a dict

Source code in immichpy/client/generated/models/system_config_machine_learning_dto.py
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
    """Create an instance of SystemConfigMachineLearningDto from a dict"""
    if obj is None:
        return None

    if not isinstance(obj, dict):
        return cls.model_validate(obj)

    _obj = cls.model_validate(
        {
            "availabilityChecks": MachineLearningAvailabilityChecksDto.from_dict(
                obj["availabilityChecks"]
            )
            if obj.get("availabilityChecks") is not None
            else None,
            "clip": CLIPConfig.from_dict(obj["clip"])
            if obj.get("clip") is not None
            else None,
            "duplicateDetection": DuplicateDetectionConfig.from_dict(
                obj["duplicateDetection"]
            )
            if obj.get("duplicateDetection") is not None
            else None,
            "enabled": obj.get("enabled"),
            "facialRecognition": FacialRecognitionConfig.from_dict(
                obj["facialRecognition"]
            )
            if obj.get("facialRecognition") is not None
            else None,
            "ocr": OcrConfig.from_dict(obj["ocr"])
            if obj.get("ocr") is not None
            else None,
            "urls": obj.get("urls"),
        }
    )
    return _obj

from_json classmethod

from_json(json_str: str) -> Optional[Self]

Create an instance of SystemConfigMachineLearningDto from a JSON string

Source code in immichpy/client/generated/models/system_config_machine_learning_dto.py
76
77
78
79
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
    """Create an instance of SystemConfigMachineLearningDto from a JSON string"""
    return cls.from_dict(json.loads(json_str))

to_dict

to_dict() -> Dict[str, Any]

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
Source code in immichpy/client/generated/models/system_config_machine_learning_dto.py
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
def to_dict(self) -> Dict[str, Any]:
    """Return the dictionary representation of the model using alias.

    This has the following differences from calling pydantic's
    `self.model_dump(by_alias=True)`:

    * `None` is only added to the output dict for nullable fields that
      were set at model initialization. Other fields with value `None`
      are ignored.
    """
    excluded_fields: Set[str] = set([])

    _dict = self.model_dump(
        by_alias=True,
        exclude=excluded_fields,
        exclude_none=True,
    )
    # override the default output from pydantic by calling `to_dict()` of availability_checks
    if self.availability_checks:
        _dict["availabilityChecks"] = self.availability_checks.to_dict()
    # override the default output from pydantic by calling `to_dict()` of clip
    if self.clip:
        _dict["clip"] = self.clip.to_dict()
    # override the default output from pydantic by calling `to_dict()` of duplicate_detection
    if self.duplicate_detection:
        _dict["duplicateDetection"] = self.duplicate_detection.to_dict()
    # override the default output from pydantic by calling `to_dict()` of facial_recognition
    if self.facial_recognition:
        _dict["facialRecognition"] = self.facial_recognition.to_dict()
    # override the default output from pydantic by calling `to_dict()` of ocr
    if self.ocr:
        _dict["ocr"] = self.ocr.to_dict()
    return _dict

to_json

to_json() -> str

Returns the JSON representation of the model using alias

Source code in immichpy/client/generated/models/system_config_machine_learning_dto.py
71
72
73
74
def to_json(self) -> str:
    """Returns the JSON representation of the model using alias"""
    # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
    return json.dumps(self.to_dict())

to_str

to_str() -> str

Returns the string representation of the model using alias

Source code in immichpy/client/generated/models/system_config_machine_learning_dto.py
67
68
69
def to_str(self) -> str:
    """Returns the string representation of the model using alias"""
    return pprint.pformat(self.model_dump(by_alias=True))