= Image.open('images/puppy.jpg').to_thumb(256,512)
im 'Puppy'),
VBox([widgets.HTML(="192px")]) widget(im, max_width
视觉小部件
用于图像的 ipywidgets
Box.__getitem__
Box.__getitem__ (i)
小部件
widget (im, *args, **layout)
将任何可通过 IPython
display
的内容转换为小部件
轮播图
carousel (children:tuple|collections.abc.MutableSequence=(), **layout)
水平滚动的轮播图
类型 | 默认值 | 详情 | |
---|---|---|---|
子项 | tuple | collections.abc.MutableSequence | () | 在轮播图中显示的 Box 对象 |
layout | VAR_KEYWORD | ||
返回值 | Box | 一个 ipywidget 轮播图 |
= [VBox([widget(im, max_width='192px'), Button(description='click')])
ts for o in range(3)]
='450px') carousel(ts, width
ImagesCleaner
ImagesCleaner (opts:tuple=(), height:int=128, width:int=256, max_n:int=30)
显示 fns
中所有图像以及一个 Dropdown
的小部件
类型 | 默认值 | 详情 | |
---|---|---|---|
选项 | tuple | () | Dropdown 菜单的选项 |
高度 | int | 128 | 缩略图高度 |
宽度 | int | 256 | 缩略图宽度 |
max_n | int | 30 | 要显示的最大图片数量 |
= get_image_files('images')
fns = ImagesCleaner(('A','B'))
w
w.set_fns(fns) w
w.delete(),w.change()
((#0) [], (#0) [])
ImageClassifierCleaner
ImageClassifierCleaner (learn, opts:tuple=(), height:int=128, width:int=256, max_n:int=30)
为一个 CNN Learner
提供一个 ImagesCleaner
的小部件
类型 | 默认值 | 详情 | |
---|---|---|---|
learn | |||
选项 | tuple | () | Dropdown 菜单的选项 |
高度 | int | 128 | 缩略图高度 |
宽度 | int | 256 | 缩略图宽度 |
max_n | int | 30 | 要显示的最大图片数量 |