Skip to content

Commit 735b9a0

Browse files
committed
Add ModelType Literal and apply to model_type
Introduce a ModelType Literal type ("pytorch" | "tensorflow") and change DLCProcessorSettings.model_type from a plain str to this constrained type, keeping the default as "pytorch". This ensures pydantic validation enforces allowed model backends.
1 parent 025a18e commit 735b9a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dlclivegui/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
Rotation = Literal[0, 90, 180, 270]
1212
TileLayout = Literal["auto", "2x2", "1x4", "4x1"]
1313
Precision = Literal["FP32", "FP16"]
14+
ModelType = Literal["pytorch", "tensorflow"]
1415

1516

1617
class CameraSettings(BaseModel):
@@ -240,7 +241,7 @@ class DLCProcessorSettings(BaseModel):
240241
resize: float = Field(default=1.0, gt=0)
241242
precision: Precision = "FP32"
242243
additional_options: dict[str, Any] = Field(default_factory=dict)
243-
model_type: str = "pytorch"
244+
model_type: ModelType = "pytorch"
244245
single_animal: bool = True
245246

246247
@field_validator("dynamic", mode="before")

0 commit comments

Comments
 (0)