Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

streamlit app using Table Transformer and OCR #200

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
4 changes: 2 additions & 2 deletions Table Transformer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def table_detector(image, THRESHOLD_PROBA):
feature_extractor = DetrFeatureExtractor(do_resize=True, size=800, max_size=800)
encoding = feature_extractor(image, return_tensors="pt")

model = DetrForObjectDetection.from_pretrained("SalML/DETR-table-detection")
model = DetrForObjectDetection.from_pretrained("microsoft/table-transformer-detection")
salman-moh marked this conversation as resolved.
Show resolved Hide resolved

with torch.no_grad():
outputs = model(**encoding)
Expand All @@ -163,7 +163,7 @@ def table_struct_recog(image, THRESHOLD_PROBA):
feature_extractor = DetrFeatureExtractor(do_resize=True, size=1000, max_size=1000)
encoding = feature_extractor(image, return_tensors="pt")

model = DetrForObjectDetection.from_pretrained("SalML/DETR-table-structure-recognition")
model = DetrForObjectDetection.from_pretrained("microsoft/table-transformer-structure-recognition")
salman-moh marked this conversation as resolved.
Show resolved Hide resolved
with torch.no_grad():
outputs = model(**encoding)

Expand Down