Johannes commited on
Commit
55c92cf
β€’
1 Parent(s): e2db66d

small update

Browse files
Files changed (2) hide show
  1. README.md +2 -2
  2. app.py +10 -4
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
  title: Homography Warping
3
- emoji: 🐠
4
  colorFrom: green
5
  colorTo: indigo
6
  sdk: gradio
7
- sdk_version: 3.3
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
1
  ---
2
  title: Homography Warping
3
+ emoji: 🌐
4
  colorFrom: green
5
  colorTo: indigo
6
  sdk: gradio
7
+ sdk_version: 3.3.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
app.py CHANGED
@@ -86,7 +86,13 @@ def infer(image_input, dst_height:str, dst_width:str):
86
  return fig
87
 
88
 
89
- description = """Homography Warping"""
 
 
 
 
 
 
90
 
91
  example_mask = np.empty((327,600,4))
92
  example_mask[:] = [0,0,0,255]
@@ -95,11 +101,11 @@ example_image_dict = {"image": "bruce.png", "mask": example_mask}
95
  Iface = gr.Interface(
96
  fn=infer,
97
  inputs=[gr.components.Image(tool="sketch"),
98
- gr.components.Textbox(label="Destination Height"),
99
- gr.components.Textbox(label="Destination Width"),
100
  ],
101
  outputs=gr.components.Plot(),
102
- #examples=[["bruce.png", example_mask], "64", "128"],
103
  title="Homography Warping",
104
  description=description,
105
  ).launch()
 
86
  return fig
87
 
88
 
89
+ description = """In this space you can warp an image using perspective transform with the Kornia library as seen in [this tutorial](https://kornia-tutorials.readthedocs.io/en/latest/warp_perspective.html).
90
+
91
+ 1. Upload an image
92
+ 2. Set 4 points into the image with your cursor, which define the area to warp
93
+ 3. Set a desired output size (or go with the default)
94
+ 4. Click Submit to run the demo
95
+ """
96
 
97
  example_mask = np.empty((327,600,4))
98
  example_mask[:] = [0,0,0,255]
 
101
  Iface = gr.Interface(
102
  fn=infer,
103
  inputs=[gr.components.Image(tool="sketch"),
104
+ gr.components.Textbox(label="Destination Height", value="64"),
105
+ gr.components.Textbox(label="Destination Width", value="128"),
106
  ],
107
  outputs=gr.components.Plot(),
108
+ #examples=[["bruce.png", example_mask, "64", "128"]],
109
  title="Homography Warping",
110
  description=description,
111
  ).launch()