lint commited on
Commit
a6d78c4
·
1 Parent(s): ab69d2e

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. demo.yaml +5 -8
demo.yaml CHANGED
@@ -3,7 +3,7 @@ lite_metadata:
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
@@ -21,7 +21,7 @@ kwargs:
21
  outputs:
22
  class_string: liteobj.listify
23
  args:
24
- - class_string: gradio.components.Number
25
  kwargs:
26
  label: output
27
  fn:
@@ -38,9 +38,6 @@ 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"
 
3
  class_string: gradio.interface.Interface
4
  kwargs:
5
  title: Gradio Webapp
6
+ description: compare two images
7
  article: null
8
  thumbnail: null
9
  theme: gradio/seafoam
 
21
  outputs:
22
  class_string: liteobj.listify
23
  args:
24
+ - class_string: gradio.components.Checkbox
25
  kwargs:
26
  label: output
27
  fn:
 
38
  ldict:
39
  class_string: gradify.exec_to_dict
40
  kwargs:
41
+ source: "from PIL import Image\n\n\ndef compare_images(image1, image2):\n\
42
+ \ img1 = Image.open(image1)\n img2 = Image.open(image2)\n return\
43
+ \ img1 == img2\n"