Fix handling of min_size argument in OpenCV component (#36335)
The OpenCV image_processing component accepts a `min_size` argument in each classifier that is then passed into the OpenCV library. The `min_size` argument is expected to be a tuple of 2 ints, and is entered into the platofrm schema as such. However, yaml will always produce a list instead of a tuple, which means in practice it's impossible to use the `min_size` argument. This changes the schema to accepts any sequence of 2 ints that is then coerced into a tuple suitable for passing to the OpenCV library.pull/36347/head
parent
aa1b32ad36
commit
5827a26dfc
|
@ -62,7 +62,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
CONF_NEIGHBORS, DEFAULT_NEIGHBORS
|
||||
): cv.positive_int,
|
||||
vol.Optional(CONF_MIN_SIZE, DEFAULT_MIN_SIZE): vol.Schema(
|
||||
(int, int)
|
||||
vol.All(vol.ExactSequence([int, int]), vol.Coerce(tuple))
|
||||
),
|
||||
}
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue