fix image input

This commit is contained in:
Ali Abid 2020-07-20 09:51:45 -07:00
parent 9cfe8dd93a
commit 9a9c49c69d
5 changed files with 14 additions and 8 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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"],

View File

@ -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.

View File

@ -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;