ISYS commited on
Commit
9224e35
1 Parent(s): aea3784
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -12,15 +12,12 @@ def greet(img):
12
  a = numb % 3
13
  return a, numb
14
 
15
- def rasp_numb(img):
16
  img = np.expand_dims(img, axis=0)
17
- return np.argmax(model.predict(img)[0])
 
 
 
18
 
19
- outputs = [
20
- gr.Textbox(label="hexadecimal color"),
21
- gr.Textbox(label="hexadecimal color")
22
- ]
23
-
24
- demo = gr.Interface(fn=greet, inputs="sketchpad", output=outputs)
25
- if __name__ == "__main__":
26
  demo.launch()
 
12
  a = numb % 3
13
  return a, numb
14
 
15
+ def process_sketch(sketch):
16
  img = np.expand_dims(img, axis=0)
17
+ sketch = np.array(sketch)
18
+ output1 = np.argmax(model.predict(img)[0])
19
+ output2 = (np.argmax(model.predict(img)[0]) % 3)
20
+ return output1, output2
21
 
22
+ demo = gr.Interface(fn=process_sketch, inputs="sketchpad", outputs=["text", "text"], title="Распознавание рисунка")
 
 
 
 
 
 
23
  demo.launch()