Spaces:
Runtime error
Runtime error
Rajiv Shah
commited on
Commit
Β·
2726e12
1
Parent(s):
0992d7b
image loading
Browse files
app.py
CHANGED
@@ -20,10 +20,10 @@ processor = LayoutLMv3Processor.from_pretrained("microsoft/layoutlmv3-base")
|
|
20 |
model = LayoutLMv3ForTokenClassification.from_pretrained("nielsr/layoutlmv3-finetuned-cord")
|
21 |
|
22 |
# load image example
|
23 |
-
dataset = load_dataset("nielsr/cord-layoutlmv3", split="test")
|
24 |
-
image = Image.open(dataset[0]["image_path"]).convert("RGB")
|
25 |
-
|
26 |
-
image.save("document.png")
|
27 |
# define id2label, label2color
|
28 |
labels = dataset.features['ner_tags'].feature.names
|
29 |
id2label = {v: k for v, k in enumerate(labels)}
|
|
|
20 |
model = LayoutLMv3ForTokenClassification.from_pretrained("nielsr/layoutlmv3-finetuned-cord")
|
21 |
|
22 |
# load image example
|
23 |
+
#dataset = load_dataset("nielsr/cord-layoutlmv3", split="test")
|
24 |
+
#image = Image.open(dataset[0]["image_path"]).convert("RGB")
|
25 |
+
image = Image.open("./test0.jpeg")
|
26 |
+
#image.save("document.png")
|
27 |
# define id2label, label2color
|
28 |
labels = dataset.features['ner_tags'].feature.names
|
29 |
id2label = {v: k for v, k in enumerate(labels)}
|