SuggestImageMixin#
- class SuggestImageMixin#
Bases:
object
Methods Summary
retrieve_image
(project_id, image_url)Returns image in byte format for an image_url :type project_id: :param project_id: Project Identifier :type image_url: :param image_url: url of an image
suggest_images
(project_id, term[, ...])Returns image url suggestions relevant to a term :type project_id: :param project_id: Project Identifier :type term: :param term: Term for image suggestion :type num_suggestions: :param num_suggestions: number of suggested image urls
Methods Documentation
- retrieve_image(project_id, image_url)#
Returns image in byte format for an image_url :type project_id: :param project_id: Project Identifier :type image_url: :param image_url: url of an image
- Example::
>>> client.retrieve_image('Xh9CeyQtTYe2cv5F11e6nQ', 'https://images.pexels.com/photos/3652898/pexels-photo-3652898.jpeg?auto=compress&cs=tinysrgb&h=350')
- suggest_images(project_id, term, num_suggestions=15)#
Returns image url suggestions relevant to a term :type project_id: :param project_id: Project Identifier :type term: :param term: Term for image suggestion :type num_suggestions: :param num_suggestions: number of suggested image urls
Example:
>>> client.suggest_images('Xh9CeyQtTYe2cv5F11e6nQ', 'apple', num_suggestions=2) [ 'https://images.pexels.com/photos/3652898/pexels-photo-3652898.jpeg?auto=compress&cs=tinysrgb&h=350', 'https://images.pexels.com/photos/4065876/pexels-photo-4065876.jpeg?auto=compress&cs=tinysrgb&h=350' ]