For some Flow tile images, a stock URL image may not suffice, or you may want to use a specific image saved locally. Virtualitics Predict has internal support for users to use custom tile images obtained from a URL or from locally-saved images.
Creating a Flow Tile Image
Using a URL
from predict_backend.flow.flow import Flow
EXAMPLE_URL = "https://blogs.3ds.com/biovia/wp-content/uploads/sites/27/2020/07/shutterstock_1141709903-scaled.jpg"
flow_img_url = EXAMPLE_URL
flow_object = Flow("Title","Description",flow_img_url)
Using a Local Image
from predict_backend.flow.flow import Flow
from projects.image_helpers import get_img_base64
# Store your images in a folder.
# In this example we store the image in the 'project_images' folder.
flow_img = get_img_base64("project_images/image_name.jpeg")
flow_object = Flow("Title","Description",flow_img)
What to Expect
The image will be displayed as your Flow tile image.
Previous Article |
Next Article |