Class to performs image search.
tflite_support
.
task
.
vision
.
ImageSearcher
(
options
:
tflite_support
.
task
.
vision
.
ImageSearcherOptions
,
cpp_searcher
:
_CppImageSearcher
)
->
None
It works by performing embedding extraction on images, followed by nearest-neighbor search in an index of embeddings through ScaNN.
Methods
create_from_file
@classmethodcreate_from_file ( model_file_path : str , index_file_path : Optional [ str ] = None ) -> 'ImageSearcher'
Creates the ImageSearcher
object from a TensorFlow Lite model.
model_file_path
index_file_path
ImageSearcher
object that's created from options
.
ValueError
ImageSearcher
object from the provided
file such as invalid file.RuntimeError
create_from_options
@classmethodcreate_from_options ( options :tflite_support . task . vision . ImageSearcherOptions) -> 'ImageSearcher'
Creates the ImageSearcher
object from image searcher options.
options
ImageSearcher
object that's created from options
.
ValueError
ImageSearcher
object from ImageSearcherOptions
such as missing the model.RuntimeError
get_user_info
get_user_info
()
->
str
Gets the user info stored in the index file.
search
search
(
image
:
tflite_support
.
task
.
vision
.
TensorImage
,
bounding_box
:
Optional
[
tflite_support
.
task
.
processor
.
BoundingBox
]
=
None
)
->
tflite_support
.
task
.
processor
.
SearchResult
Search for image with similar semantic meaning.
This method performs actual feature extraction on the provided image input, followed by nearest-neighbor search in the index.
image
bounding_box
ValueError
RuntimeError


