Commit
·
37c7c40
1
Parent(s):
b60a57d
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,10 @@ os.system('pip install -q torch==1.10.0+cu111 torchvision==0.11+cu111 -f https:/
|
|
| 9 |
#os.system('pip install -q detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html')
|
| 10 |
os.system('pip install git+https://github.com/facebookresearch/detectron2.git')
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
import gradio as gr
|
| 13 |
import re
|
| 14 |
import string
|
|
@@ -72,7 +76,7 @@ def app_outputs(uploaded_pdf):
|
|
| 72 |
num_images = len(images)
|
| 73 |
|
| 74 |
if not msg.startswith("Error with the PDF"):
|
| 75 |
-
|
| 76 |
# Extraction of image data (text and bounding boxes)
|
| 77 |
dataset, lines, row_indexes, par_boxes, line_boxes = extraction_data_from_image(images)
|
| 78 |
# prepare our data in the format of the model
|
|
|
|
| 9 |
#os.system('pip install -q detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html')
|
| 10 |
os.system('pip install git+https://github.com/facebookresearch/detectron2.git')
|
| 11 |
|
| 12 |
+
import detectron2
|
| 13 |
+
from detectron2.utils.logger import setup_logger
|
| 14 |
+
setup_logger()
|
| 15 |
+
|
| 16 |
import gradio as gr
|
| 17 |
import re
|
| 18 |
import string
|
|
|
|
| 76 |
num_images = len(images)
|
| 77 |
|
| 78 |
if not msg.startswith("Error with the PDF"):
|
| 79 |
+
|
| 80 |
# Extraction of image data (text and bounding boxes)
|
| 81 |
dataset, lines, row_indexes, par_boxes, line_boxes = extraction_data_from_image(images)
|
| 82 |
# prepare our data in the format of the model
|