Create run.py
Browse files
run.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import deepdoctection as dd
|
| 2 |
+
from IPython.core.display import HTML
|
| 3 |
+
from matplotlib import pyplot as plt
|
| 4 |
+
|
| 5 |
+
analyzer = dd.get_dd_analyzer() # instantiate the built-in analyzer similar to the Hugging Face space demo
|
| 6 |
+
|
| 7 |
+
df = analyzer.analyze(path = "/content/imgs") # setting up pipeline
|
| 8 |
+
df.reset_state() # Trigger some initialization
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
for pg in iter(df):
|
| 13 |
+
image = pg.viz()
|
| 14 |
+
plt.figure(figsize = (25,17))
|
| 15 |
+
plt.axis('off')
|
| 16 |
+
plt.imshow(image)
|
| 17 |
+
for idx in range(len(pg.tables)):
|
| 18 |
+
HTML(pg.tables[idx].html)
|