We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 490c340 commit 316c336Copy full SHA for 316c336
fastembed/image/transform/operators.py
@@ -73,6 +73,28 @@ def __call__(
73
74
@classmethod
75
def from_config(cls, config: Dict[str, Any]) -> "Compose":
76
+ """Creates processor from a config dict.
77
+
78
+ Args:
79
+ config (Dict[str, Any]): Configuration dictionary.
80
81
+ Valid keys:
82
+ - do_resize
83
+ - size
84
+ - do_center_crop
85
+ - crop_size
86
+ - do_rescale
87
+ - rescale_factor
88
+ - do_normalize
89
+ - image_mean
90
+ - image_std
91
+ Valid size keys (nested):
92
+ - {"height", "width"}
93
+ - {"shortest_edge"}
94
95
+ Returns:
96
+ Compose: Image processor.
97
+ """
98
transforms = [ConvertToRGB()]
99
if config.get("do_resize", False):
100
size = config["size"]
0 commit comments