Skip to content

Images

GenerateImage

The generateImage() function generates an image based on a given text input. The generated image is then uploaded to the file manager and the image title is returned.

1
2
3
4
5
6
7
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

text = "A cat in the middle of a desert with a flying helicopter"

result = blip_obj.generateImage(text=text)

AskImage

The askImage() function enables you to ask any text queries on a given image that is present in the file manager. The image_id and query are given as inputs and it responds with a text output.

1
2
3
4
5
6
7
8
9
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

img = "img/foo.jpg"

query = "How many objectd do you see in this image and is there any brand name written in this image?"

result = blip_obj.askImage(image_id=img, query=query)

DescribeImage

The describeImage() function returns a detailed description of what is present in an image. The image id from the file manager has to be provided as the input.

1
2
3
4
5
6
7
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

img = "img/foo.jpg"

result = blip_obj.describeImage(file_id=img, language="spanish")

generateImageStableDiffusion

The generateImageStableDiffusion() function generates an image based on the given text prompt using Stable Diffusion. This function takes a string of text as input, which is used to create a corresponding image.

1
2
3
4
5
6
7
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

text_prompt = "A serene mountain landscape at sunset"

result = blip_obj.generateImageStableDiffusion(text=text_prompt)

textFromImageOpenAI

The textFromImageOpenAI() function extracts text from an image using OpenAI's OCR capabilities. The function requires an image file ID from the file manager as input.

1
2
3
4
5
6
7
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

img = "img/foo.jpg"

result = blip_obj.textFromImageOpenAI(file_id=img)

textFromImage

The textFromImage() function extracts text from an image. It requires the image file ID from the file manager as input to process and return the extracted text.

1
2
3
4
5
6
7
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

img = "img/foo.jpg"

result = blip_obj.textFromImage(file_id=img)

recognizeCelebrities

The recognizeCelebrities() function identifies and returns information about celebrities present in an image. It requires the image file ID from the file manager as input.

1
2
3
4
5
6
7
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

img = "img/foo.jpg"

result = blip_obj.recognizeCelebrities(file_id=img)

detectExplicitContent

The detectExplicitContent() function detects explicit or inappropriate content in an image. It requires the image file ID from the file manager as input and checks for any content that may be flagged as explicit.

1
2
3
4
5
6
7
from blipper import Blipper

blip_obj = Blipper(blipper_api_key="lqqRYOOnSerIOP973hjskR", model="galileo")

img = "img/foo.jpg"

result = blip_obj.detectExplicitContent(file_id=img)