find_objects()¶
This method, available in certain handlers, allows for the search of a specific class within the received predictions. It can be used in a non-blocking manner by setting up a callback that will be triggered when the desired class is found, or it can be used in a blocking mode, where the method will return the prediction when the desired class is found. If callback_async is defined, the callback is ignored. If wait is False, one of the callbacks must be defined.
Reference¶
Arguments¶
Arguments |
Type |
Default value |
Description |
|---|---|---|---|
objects |
|
List of objects to be found. |
|
callback |
|
|
Callback that will be invoked when an object in the objects list will be found. |
callback_async |
|
|
Asynchronous callback that will be invoked when an object in the objects list will be found. |
wait |
|
|
If set to
|
timeout |
|
|
It is only used
when wait
is set to
|
as_dict |
|
|
If set to
|
Return¶
if as_dict is True and wait is True:
Type |
Description |
|---|---|
|
Dictionary with prediccions. |
if as_dict is False and wait is True:
Type |
Description |
|---|---|
|
List with prediccions. |
if wait is False:
None
Exceptions¶
RayaCVNotValidLabel
See the complete list of cv exceptions.
Examples¶
...
resp = await self.predictor.find_objects(
objects=['cup'],
wait=True,
timeout=10.0
)
...