amir22010 commited on
Commit
717e5c7
·
1 Parent(s): e816a93

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +4 -4
  2. ja_val_49.jpg +0 -0
app.py CHANGED
@@ -21,10 +21,10 @@ processor = LayoutXLMProcessor.from_pretrained("amir22010/layoutxlm-xfund-ja")
21
  model = LayoutLMv2ForTokenClassification.from_pretrained("amir22010/layoutxlm-xfund-ja",num_labels = 7)
22
 
23
  # load image example
24
- dataset = load_dataset("ranpox/xfund", 'xfund.ja', split="validation")
25
- image = Image.open(dataset[0]["image"][0]).convert("RGB")
26
- image = Image.open("./invoice.png")
27
- image.save("document.png")
28
  # define id2label, label2color
29
  labels = [
30
  'O',
 
21
  model = LayoutLMv2ForTokenClassification.from_pretrained("amir22010/layoutxlm-xfund-ja",num_labels = 7)
22
 
23
  # load image example
24
+ #dataset = load_dataset("ranpox/xfund", 'xfund.ja', split="validation")
25
+ #image = Image.open(dataset[0]["image"][0]).convert("RGB")
26
+ image = Image.open("./ja_val_49.jpg").convert("RGB")
27
+ image.save("document.jpg")
28
  # define id2label, label2color
29
  labels = [
30
  'O',
ja_val_49.jpg ADDED