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
Luke Pomfrey 2020-06-01 12:15:01 +00:00 committed by GitHub
parent aa1b32ad36
commit 5827a26dfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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))
),
}
),