# Vision widgets


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/widgets.py#L23"
target="_blank" style="float:right; font-size:smaller">source</a>

### Box.\_\_getitem\_\_

``` python
def __getitem__(
    i
):
```

*Call self as a function.*

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/widgets.py#L26"
target="_blank" style="float:right; font-size:smaller">source</a>

### widget

``` python
def widget(
    im, *args, **layout
)->Output:
```

*Convert anything that can be `display`ed by `IPython` into a widget*

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

    VBox(children=(HTML(value='Puppy'), Output(layout=Layout(max_width='192px'))))

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/widgets.py#L41"
target="_blank" style="float:right; font-size:smaller">source</a>

### carousel

``` python
def carousel(
    children:tuple | collections.abc.MutableSequence=(), # `Box` objects to display in a carousel
    **layout
)->Box: # An `ipywidget`'s carousel
```

*A horizontally scrolling carousel*

``` python
ts = [VBox([widget(im, max_width='192px'), Button(description='click')])
      for o in range(3)]

carousel(ts, width='450px')
```

    Box(children=(VBox(children=(Output(layout=Layout(max_width='192px')), Button(description='click', style=Butto…

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/widgets.py#L62"
target="_blank" style="float:right; font-size:smaller">source</a>

### ImagesCleaner

``` python
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`*

``` python
fns = get_image_files('images')
w = ImagesCleaner(('A','B'))
w.set_fns(fns)
w
```

    Box(children=(VBox(children=(Output(layout=Layout(height='128px')), Dropdown(layout=Layout(width='max-content'…

``` python
w.delete(),w.change()
```

    ((#0) [], (#0) [])

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/vision/widgets.py#L109"
target="_blank" style="float:right; font-size:smaller">source</a>

### ImageClassifierCleaner

``` python
def ImageClassifierCleaner(
    learn, **kwargs
):
```

*A widget that provides an
[`ImagesCleaner`](https://docs.fast.ai/vision.widgets.html#imagescleaner)
for a CNN [`Learner`](https://docs.fast.ai/learner.html#learner)*
