DimaML commited on
Commit
4440e4a
·
verified ·
1 Parent(s): c62975f

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import numpy as np
3
+
4
+ def gray(image):
5
+ grayed_image = np.mean(image, 2)
6
+ image_max = np.max(grayed_image)
7
+
8
+ if image_max > 1:
9
+ grayed_image = grayed_image / image_max
10
+
11
+ return grayed_image
12
+
13
+ app = gr.Interface(
14
+ gray,
15
+ 'image',
16
+ 'image',
17
+ flagging_options=['Work', 'Don`t work'],
18
+ live=True,
19
+ )
20
+
21
+ app.launch(height=800)