Views
No views yet
1from transformers import Pix2StructForConditionalGeneration, AutoProcessor
2from PIL import Image
3
4processor = AutoProcessor.from_pretrained("brainventures/deplot_kr")
5model = Pix2StructForConditionalGeneration.from_pretrained("brainventures/deplot_kr")
6
7image_path = "IMAGE_PATH"
8image = Image.open(image_path)
9
10inputs = processor(images=image, return_tensors="pt")
11pred = model.generate(flattened_patches=flattened_patches, attention_mask=attention_mask, max_length=1024)
12print(processor.batch_decode(deplot_generated_ids, skip_special_token=True)[0])
13
| metrics name | % |
|---|---|
| RNSS (Relative Number Set Similarity) | 98.1615 |
| RMS (Relative Mapping Similarity) Precision | 83.1615 |
| RMS Recall | 26.3549 |
| RMS F1 Score | 31.5633 |