-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added docments for 09c_vision.widgets.ipynb #82
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few nits as a first review
…nto vision-widgets update
Updated carusel function docment Co-authored-by: Zachary Mueller <[email protected]>
Updated _get_iw_info docments Co-authored-by: Zachary Mueller <[email protected]>
Update ds_idx in docment in _get_iw_info function Co-authored-by: Zachary Mueller <[email protected]>
Update on_change_ds docment Co-authored-by: Zachary Mueller <[email protected]>
Hi! I hope I fixed the issues mentioned. Waiting for another feedback :) |
LG2M! Will let @tyoc213 review as well :) |
@omer-dor the only change I see is that |
fastai/vision/widgets.py
Outdated
for o in change['owner'].children: | ||
if not o.layout.flex: o.layout.flex = '0 0 auto' | ||
|
||
# Cell | ||
def carousel(children=(), **layout): | ||
def carousel( | ||
children:tuple=(), # `Box` objects to display in a carousel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think children is limited to tuple
but can be a list too.
fastai/vision/widgets.py
Outdated
@@ -38,32 +44,55 @@ def carousel(children=(), **layout): | |||
return res | |||
|
|||
# Cell | |||
def _open_thumb(fn, h, w): return Image.open(fn).to_thumb(h, w).convert('RGBA') | |||
def _open_thumb( | |||
fn, # A path of an image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn, # A path of an image | |
fn:(Path, str), # A path of an image |
|
||
# Cell | ||
class ImagesCleaner: | ||
"A widget that displays all images in `fns` along with a `Dropdown`" | ||
def __init__(self, opts=(), height=128, width=256, max_n=30): | ||
def __init__(self, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing type hints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I added them
fastai/vision/widgets.py
Outdated
fn, # A path of an image | ||
h:int, # Thumbnail Height | ||
w:int # Thumbnail Width | ||
)-> Image: # `PIL` image to display |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
)-> Image: # `PIL` image to display | |
) -> Image: # `PIL` image to display |
fastai/vision/widgets.py
Outdated
"A widget that provides an `ImagesCleaner` with a CNN `Learner`" | ||
def __init__(self, learn, **kwargs): | ||
"A widget that provides an `ImagesCleaner` for a CNN `Learner`" | ||
def __init__(self,learn,**kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def __init__(self,learn,**kwargs): | |
def __init__(self, learn, **kwargs): |
fastai/vision/widgets.py
Outdated
@@ -17,19 +17,25 @@ | |||
def __getitem__(self:Box, i): return self.children[i] | |||
|
|||
# Cell | |||
def widget(im, *args, **layout): | |||
"Convert anything that can be `display`ed by IPython into a widget" | |||
def widget(im,*args,**layout)-> Output: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def widget(im,*args,**layout)-> Output: | |
def widget(im, *args, **layout) -> Output: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fixes issue #31