Skip to content

Commit

Permalink
fix: eval outside loop
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesmindee committed Jan 18, 2022
1 parent 781e22f commit 7cbfc60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def main(args):
e2e_metric = OCRMetric(iou_thresh=args.iou, use_polygons=not args.eval_straight)

sample_idx = 0
extraction_fn = extract_crops if args.eval_straight else extract_rcrops

for dataset in sets:
for page, target in tqdm(dataset):
# GT
Expand All @@ -84,7 +86,6 @@ def main(args):
gt_boxes = np.stack([xmin, ymin, xmax, ymax], axis=-1)

# Forward
extraction_fn = extract_crops if args.eval_straight else extract_rcrops
if is_tf_available():
out = predictor(page[None, ...])
crops = extraction_fn(page, gt_boxes)
Expand Down

0 comments on commit 7cbfc60

Please sign in to comment.