Spaces:
Build error
Build error
Update app.py
Browse files10 unmodified lines11121314151617181920215 unmodified lines2728293031323310 unmodified linesMODEL = LayoutLMForQuestionAnswering.from_pretrained(model_tag).eval()TOKENIZER = AutoTokenizer.from_pretrained(model_tag)OCR = PaddleOCR(use_angle_cls=True,lang="en",det_limit_side_len=10_000,det_db_score_mode="slow",enable_mlkdnn=True,)5 unmodified linesimage_np = np.array(image)if ocr_engine == PADDLE_OCR_LABEL:ocr_result = OCR.ocr(image_np)[0]words = [x[1][0] for x in ocr_result]boxes = np.asarray([x[0] for x in ocr_result]) # (n_boxes, 4, 2)10 unmodified lines1112131415161718195 unmodified lines2526272829303110 unmodified linesMODEL = LayoutLMForQuestionAnswering.from_pretrained(model_tag).eval()TOKENIZER = AutoTokenizer.from_pretrained(model_tag)OCR = PaddleOCR(lang="en",det_limit_side_len=10_000,det_db_score_mode="slow",)5 unmodified linesimage_np = np.array(image)if ocr_engine == PADDLE_OCR_LABEL:ocr_result = OCR.ocr(image_np, cls=False)[0]words = [x[1][0] for x in ocr_result]boxes = np.asarray([x[0] for x in ocr_result]) # (n_boxes, 4, 2)
app.py+1-3