Skip to content

Commit 316c336

Browse files
authored
new: add docstring with preprocessor keys (#245)
1 parent 490c340 commit 316c336

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

fastembed/image/transform/operators.py

+22
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,28 @@ def __call__(
7373

7474
@classmethod
7575
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+
"""
7698
transforms = [ConvertToRGB()]
7799
if config.get("do_resize", False):
78100
size = config["size"]

0 commit comments

Comments
 (0)