Spaces:
Build error
Build error
Upload 2 files
Browse files- app.py +4 -4
- 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("./
|
27 |
-
image.save("document.
|
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
![]() |