vteam27 commited on
Commit
fe10d73
1 Parent(s): 8b21536

added examples,file download, lfs

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.jpg filter=lfs diff=lfs merge=lfs -text
37
+ *.png filter=lfs diff=lfs merge=lfs -text
Examples/Book.png ADDED

Git LFS Details

  • SHA256: 45bf8d8c824d48de2013e572bffcedadcbdc84cda21fb73f5f83ecb809aec803
  • Pointer size: 133 Bytes
  • Size of remote file: 16 MB
Examples/Files.jpg ADDED

Git LFS Details

  • SHA256: bc1979e548161bb556a037594b3945749419b2367f93acac00e53c6d621ee009
  • Pointer size: 132 Bytes
  • Size of remote file: 4.37 MB
Examples/Manuscript.jpg ADDED

Git LFS Details

  • SHA256: 4a717cd9c625b7b59ebb80b52b0b3fba47c69e61f881ecd4e4f8ea1bb8883ddf
  • Pointer size: 132 Bytes
  • Size of remote file: 4.54 MB
Examples/News.png ADDED

Git LFS Details

  • SHA256: 5384175e709017ad917f56ff758bce9164444992be3bcad8fe52f7f83343744d
  • Pointer size: 131 Bytes
  • Size of remote file: 388 kB
app.py CHANGED
@@ -23,8 +23,24 @@ def greet(img):
23
  res=res + " " + obj3.value
24
  res=res + "\n"
25
  res=res + "\n"
26
- return res
 
 
 
 
 
27
 
28
- demo = gr.Interface(fn=greet, inputs=gr.Image(type="pil"), outputs="text", title=title, description=description)
 
 
 
 
 
 
 
 
 
 
 
29
 
30
- demo.launch()
 
23
  res=res + " " + obj3.value
24
  res=res + "\n"
25
  res=res + "\n"
26
+ _output_name = "RESULT_OCR.txt"
27
+ open(_output_name, 'w').close() # clear file
28
+ with open(_output_name, "w", encoding="utf-8", errors="ignore") as f:
29
+ f.write(res)
30
+ print("Writing into file")
31
+ return res, _output_name
32
 
33
+ demo = gr.Interface(fn=greet,
34
+ inputs=gr.Image(type="pil"),
35
+ outputs=["text", "file"],
36
+ title=title,
37
+ description=description
38
+ examples=[
39
+ ["Examples\Book.png"],
40
+ ["Examples\News.png"],
41
+ ["Examples\Manuscript.jpg"],
42
+ ["Examples\Files.jpg"],
43
+ ],
44
+ )
45
 
46
+ demo.launch(debug=True)