mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-01 11:45:36 +08:00
fix image input
This commit is contained in:
parent
9cfe8dd93a
commit
9a9c49c69d
@ -238,7 +238,7 @@ class Image(AbstractInput):
|
||||
Input type: numpy.array
|
||||
"""
|
||||
|
||||
def __init__(self, shape=(224, 224), image_mode='RGB', label=None):
|
||||
def __init__(self, shape=None, image_mode='RGB', label=None):
|
||||
'''
|
||||
Parameters:
|
||||
shape (Tuple[int, int]): shape to crop and resize image to; if None, matches input image size.
|
||||
|
@ -6,7 +6,6 @@
|
||||
}
|
||||
.view_holders {
|
||||
flex-grow: 1;
|
||||
height: calc(100% - 36px);
|
||||
background-color: #CCCCCC;
|
||||
position: relative;
|
||||
}
|
||||
@ -90,7 +89,11 @@
|
||||
.edit_holder {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 6px;
|
||||
position: relative;
|
||||
}
|
||||
.edit_image {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
.interface_button {
|
||||
padding: 6px;
|
||||
|
@ -13,8 +13,8 @@ def flip2(image):
|
||||
return np.fliplr(image)
|
||||
|
||||
|
||||
gr.Interface([flip, flip2],
|
||||
gr.inputs.Image(shape=(50, 50, 3)),
|
||||
gr.Interface(flip,
|
||||
gr.inputs.Image(),
|
||||
["image"],
|
||||
examples=[
|
||||
["images/cheetah1.jpg"],
|
||||
|
@ -238,7 +238,7 @@ class Image(AbstractInput):
|
||||
Input type: numpy.array
|
||||
"""
|
||||
|
||||
def __init__(self, shape=(224, 224), image_mode='RGB', label=None):
|
||||
def __init__(self, shape=None, image_mode='RGB', label=None):
|
||||
'''
|
||||
Parameters:
|
||||
shape (Tuple[int, int]): shape to crop and resize image to; if None, matches input image size.
|
||||
|
@ -6,7 +6,6 @@
|
||||
}
|
||||
.view_holders {
|
||||
flex-grow: 1;
|
||||
height: calc(100% - 36px);
|
||||
background-color: #CCCCCC;
|
||||
position: relative;
|
||||
}
|
||||
@ -90,7 +89,11 @@
|
||||
.edit_holder {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 6px;
|
||||
position: relative;
|
||||
}
|
||||
.edit_image {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
.interface_button {
|
||||
padding: 6px;
|
||||
|
Loading…
Reference in New Issue
Block a user