Ankur Goyal commited on
Commit
8393858
1 Parent(s): fcfd908

Only display first page bounding boxes

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. requirements.txt +1 -1
app.py CHANGED
@@ -118,7 +118,7 @@ def process_question(question, document, model=list(CHECKPOINTS.keys())[0]):
118
  # prediction for now
119
  break
120
 
121
- if "start" in p and "end" in p:
122
  x1, y1, x2, y2 = normalize_bbox(
123
  expand_bbox(lift_word_boxes(document)[p["start"] : p["end"] + 1]),
124
  image.width,
 
118
  # prediction for now
119
  break
120
 
121
+ if "start" in p and "end" in p and p.get("page") == 0:
122
  x1, y1, x2, y2 = normalize_bbox(
123
  expand_bbox(lift_word_boxes(document)[p["start"] : p["end"] + 1]),
124
  image.width,
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
  torch
2
  git+https://github.com/huggingface/transformers.git@21f6f58721dd9154357576be6de54eefef1f1818
3
- git+https://github.com/impira/docquery.git@60f743bfa02fb6868da9b6895d5eaf9f8407e776
4
  sentencepiece
 
1
  torch
2
  git+https://github.com/huggingface/transformers.git@21f6f58721dd9154357576be6de54eefef1f1818
3
+ git+https://github.com/impira/docquery.git@5de147aa7df285829a8d064f3ca2c7ac74efe0f8
4
  sentencepiece