JaMe76 commited on
Commit
72386ad
1 Parent(s): 086c7d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -19,15 +19,16 @@ def analyze_image(img):
19
  df = analyzer.analyze(dataset_dataflow=df)
20
  df.reset_state()
21
  dp = next(iter(df))
22
-
23
-
24
- return dp.viz(show_table_structure=False)
 
25
 
26
  inputs = gr.inputs.Image(type='numpy', label="Original Image")
27
- outputs = gr.outputs.Image(type="numpy", label="Output Image")
28
 
29
- title = "Deepdoctection"
30
- description = "A Document AI Package"
31
 
32
  examples = [['sample_1.jpg'],['sample_2.png']]
33
 
 
19
  df = analyzer.analyze(dataset_dataflow=df)
20
  df.reset_state()
21
  dp = next(iter(df))
22
+ out = dp.as_dict()
23
+ out.pop("image)
24
+
25
+ return dp.viz(show_table_structure=False), out
26
 
27
  inputs = gr.inputs.Image(type='numpy', label="Original Image")
28
+ outputs = [gr.outputs.Image(type="numpy", label="Output Image"), "JSON"]
29
 
30
+ title = "Deepdoctection - A Document AI Package"
31
+ description = "Demonstration of layout analysis and output of a document page."
32
 
33
  examples = [['sample_1.jpg'],['sample_2.png']]
34