find_tags
  • 1 Minute to read

find_tags


Article summary

This method, available in tags detector handlers, allows for the search of a specific tag 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 tag is found, or it can be used in a blocking mode, where the method will return the prediction when the desired tag is found. If callback_async is defined, the callback is ignored. If wait is False, one of the callbacks must be defined.

Reference

Arguments

ArgumentsTypeDefault valueDescription
tagsdict-Dictionary of tags to find, the key must be the family and the value of the key a list with the tag/s to find
callbackcallableNoneCallback that will be invoked when an object in the objects list will be found.
callback_asynccallableNoneAsynchronous callback that will be invoked when an object in the objects list will be found.
waitboolFalseIf set to true, the method works in blocking mode until it found the objects.
timeoutfloat0.0It is only used when wait is set to true. If the specified timeout is reached without finding the object, it will return an empty result.
as_dictboolFalseIf set to true, the predictions will be sent as a dictionary; otherwise, they will be returned as a list.

Return

if as_dict is True and wait is True:

TypeDescription
dictDictionary with prediccions.

if as_dict is False and wait is True:

TypeDescription
listList with prediccions.

if wait is False:
None

Exceptions

  • RayaCVNotValidLabel

See the complete list of cv exceptions.

Examples

...
tags_to_find = {'tag36h11': [1,2]}
resp = await self.predictor.find_objects(
        tags=tags_to_find, 
        wait=True, 
        timeout=10.0
    )
...

Was this article helpful?