Vision widgets

Open In Colab

ipywidgets for images

  1. /usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
  2. return torch._C._cuda_getDeviceCount() > 0

Box.__getitem__[source]

Box.__getitem__(i)

widget[source]

widget(im, *args, **layout)

Convert anything that can be displayed by IPython into a widget

  1. im = Image.open('images/puppy.jpg').to_thumb(256,512)
  2. VBox([widgets.HTML('Puppy'),
  3. widget(im, max_width="192px")])

carousel[source]

carousel(children=(), **layout)

A horizontally scrolling carousel

  1. ts = [VBox([widget(im, max_width='192px'), Button(description='click')])
  2. for o in range(3)]
  3. carousel(ts, width='450px')

class ImagesCleaner[source]

ImagesCleaner(opts=(), height=128, width=256, max_n=30)

A widget that displays all images in fns along with a Dropdown

  1. fns = get_image_files('images')
  2. w = ImagesCleaner(('A','B'))
  3. w.set_fns(fns)
  4. w
  1. w.delete(),w.change()
  1. ((#0) [], (#0) [])

class ImageClassifierCleaner[source]

ImageClassifierCleaner(learn, opts=(), height=128, width=256, max_n=30) :: GetAttr

A widget that provides an ImagesCleaner with a CNN Learner


Company logo

©2021 fast.ai. All rights reserved.
Site last generated: Mar 31, 2021