ObjectClassesList is a widget that allows users to view a list of all given object classes. The widget provides a flexible display option with a choice of single-column or multiple-column layouts. It also allows users to select or deselect one or more classes, making it easy to manage and organize object classes. This widget is a useful tool for visualizing and selecting classes in Supervisely.
You can find this example in our Github repository:
Import libraries
import os
from random import randint
import supervisely as sly
from dotenv import load_dotenv
from supervisely.app.widgets import Button, Card, Container
from supervisely.app.widgets import Image, ObjectClassesList, ProjectThumbnail
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
load_dotenv("local.env")
load_dotenv(os.path.expanduser("~/supervisely.env"))
api = sly.Api()