Upload folder using huggingface_hub
Browse files
demo.yaml
CHANGED
|
@@ -3,7 +3,7 @@ lite_metadata:
|
|
| 3 |
class_string: gradio.interface.Interface
|
| 4 |
kwargs:
|
| 5 |
title: Gradio Webapp
|
| 6 |
-
description:
|
| 7 |
article: null
|
| 8 |
thumbnail: null
|
| 9 |
theme: gradio/seafoam
|
|
@@ -12,31 +12,35 @@ kwargs:
|
|
| 12 |
inputs:
|
| 13 |
class_string: liteobj.listify
|
| 14 |
args:
|
| 15 |
-
- class_string: gradio.components.
|
| 16 |
kwargs:
|
| 17 |
-
label:
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
outputs:
|
| 20 |
class_string: liteobj.listify
|
| 21 |
args:
|
| 22 |
-
- class_string: gradio.components.
|
| 23 |
kwargs:
|
| 24 |
label: output
|
| 25 |
-
type: pil
|
| 26 |
fn:
|
| 27 |
class_string: gradify.gradify_closure
|
| 28 |
kwargs:
|
| 29 |
argmaps:
|
| 30 |
class_string: liteobj.listify
|
| 31 |
args:
|
| 32 |
-
- label:
|
|
|
|
|
|
|
| 33 |
postprocessing: null
|
| 34 |
func_kwargs: {}
|
| 35 |
ldict:
|
| 36 |
class_string: gradify.exec_to_dict
|
| 37 |
kwargs:
|
| 38 |
-
source: "from PIL import Image\
|
| 39 |
-
\
|
| 40 |
-
\
|
| 41 |
-
\
|
| 42 |
-
\
|
|
|
|
|
|
| 3 |
class_string: gradio.interface.Interface
|
| 4 |
kwargs:
|
| 5 |
title: Gradio Webapp
|
| 6 |
+
description: 'Given two png images, find the L1 loss '
|
| 7 |
article: null
|
| 8 |
thumbnail: null
|
| 9 |
theme: gradio/seafoam
|
|
|
|
| 12 |
inputs:
|
| 13 |
class_string: liteobj.listify
|
| 14 |
args:
|
| 15 |
+
- class_string: gradio.components.Textbox
|
| 16 |
kwargs:
|
| 17 |
+
label: image1
|
| 18 |
+
- class_string: gradio.components.Textbox
|
| 19 |
+
kwargs:
|
| 20 |
+
label: image2
|
| 21 |
outputs:
|
| 22 |
class_string: liteobj.listify
|
| 23 |
args:
|
| 24 |
+
- class_string: gradio.components.Number
|
| 25 |
kwargs:
|
| 26 |
label: output
|
|
|
|
| 27 |
fn:
|
| 28 |
class_string: gradify.gradify_closure
|
| 29 |
kwargs:
|
| 30 |
argmaps:
|
| 31 |
class_string: liteobj.listify
|
| 32 |
args:
|
| 33 |
+
- label: image1
|
| 34 |
+
postprocessing: null
|
| 35 |
+
- label: image2
|
| 36 |
postprocessing: null
|
| 37 |
func_kwargs: {}
|
| 38 |
ldict:
|
| 39 |
class_string: gradify.exec_to_dict
|
| 40 |
kwargs:
|
| 41 |
+
source: "from PIL import Image\n\n\ndef l1_loss(image1, image2):\n img1\
|
| 42 |
+
\ = Image.open(image1)\n img2 = Image.open(image2)\n pixels1 = img1.load()\n\
|
| 43 |
+
\ pixels2 = img2.load()\n width, height = img1.size\n loss =\
|
| 44 |
+
\ 0\n for x in range(width):\n for y in range(height):\n \
|
| 45 |
+
\ for c in range(3):\n loss += abs(pixels1[x, y][c]\
|
| 46 |
+
\ - pixels2[x, y][c])\n return loss / (width * height * 3)\n"
|