im = Image.open('images/puppy.jpg').to_thumb(256,512)
VBox([widgets.HTML('Puppy'),
widget(im, max_width="192px")])Vision widgets
ipywidgets for images
Box.__getitem__
def __getitem__(
i
):
widget
def widget(
im, args:VAR_POSITIONAL, layout:VAR_KEYWORD
)->Output:
Convert anything that can be displayed by IPython into a widget
carousel
def carousel(
children:tuple | MutableSequence=(), # `Box` objects to display in a carousel
layout:VAR_KEYWORD
)->Box: # An `ipywidget`'s carousel
A horizontally scrolling carousel
ts = [VBox([widget(im, max_width='192px'), Button(description='click')])
for o in range(3)]
carousel(ts, width='450px')ImagesCleaner
def ImagesCleaner(
opts:tuple=(), # Options for the `Dropdown` menu
height:int=128, # Thumbnail Height
width:int=256, # Thumbnail Width
max_n:int=30, # Max number of images to display
):
A widget that displays all images in fns along with a Dropdown
fns = get_image_files('images')
w = ImagesCleaner(('A','B'))
w.set_fns(fns)
ww.delete(),w.change()((#0) [], (#0) [])
ImageClassifierCleaner
def ImageClassifierCleaner(
learn, kwargs:VAR_KEYWORD
):
A widget that provides an ImagesCleaner for a CNN Learner