omoured's picture
Update README.md
ea2063e verified
metadata
license: cc-by-4.0
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
      - split: val
        path: data/val-*
      - split: test
        path: data/test-*
dataset_info:
  features:
    - name: image_name
      dtype: string
    - name: image
      dtype: image
    - name: width
      dtype: int32
    - name: height
      dtype: int32
    - name: instances
      sequence:
        - name: category_id
          dtype: int32
        - name: mask
          sequence:
            sequence: float32
  splits:
    - name: train
      num_bytes: 8566253
      num_examples: 200
    - name: val
      num_bytes: 4532786
      num_examples: 100
    - name: test
      num_bytes: 3809329
      num_examples: 100
  download_size: 16498520
  dataset_size: 16908368

Line Graphics Digitization: A Step Towards Full Automation

Omar Moured, Jiaming Zhang, Alina Roitberg, Thorsten Schwarz, Rainer Stiefelhagen

Paper Dataset

Example visualization

Dataset Summary

The dataset includes instance segmentation masks for 400 real line chart images, manually labeled into 11 categories by professionals. These images were collected from 5 different professions to enhance diversity. In our paper, we studied two levels of segmentation: coarse-level, where we segmented (spines, axis-labels, legend, lines, titles), and fine-level, where we further segmented each category into x and y subclasses (except for legend and lines), and individually segmented each line.

Dataset structure (train, validation, test)

  • image - contains the PIL image of the chart
  • image_name - image name with PNG extension
  • width - original image width
  • height - original image height
  • instances - contains N number of COCO format instances. Check the sample visulization code below.

Sample Usage

[optional] install pycocotools to rendeder masks with below code.

from datasets import load_dataset
from pycocotools import mask
import matplotlib.pyplot as plt
import random

# Load dataset
ds = load_dataset("omoured/line-graphics-dataset")

# Class ID to name
id_to_name = {
    0: "Label", 1: "Legend", 2: "Line", 3: "Spine",
    4: "Title", 5: "ptitle", 6: "xlabel", 7: "xspine",
    8: "xtitle", 9: "ylabel", 10: "yspine", 11: "ytitle"
}

# Random image + instance
sample = random.choice(ds["val"])
img = sample["image"]
i = random.randint(0, len(sample["instances"]["mask"]) - 1)

# Get mask + class info
poly = sample["instances"]["mask"][i]
cat_id = sample["instances"]["category_id"][i]
cat_name = id_to_name.get(cat_id, "Unknown")

# Decode and plot
rle = mask.frPyObjects(poly, sample["height"], sample["width"])
bin_mask = mask.decode(rle)

plt.imshow(img)
plt.imshow(bin_mask, alpha=0.5, cmap="jet")
plt.title(f"imgname: {sample['image_name']}, inst: {cat_name}")
plt.axis("off")
plt.show()

Copyrights

This dataset is published under the CC-BY 4.0 license, which allows for unrestricted usage, but it should be cited when used.

Citation

@inproceedings{moured2023line,
  title={Line Graphics Digitization: A Step Towards Full Automation},
  author={Moured, Omar and Zhang, Jiaming and Roitberg, Alina and Schwarz, Thorsten and Stiefelhagen, Rainer},
  booktitle={International Conference on Document Analysis and Recognition},
  pages={438--453},
  year={2023},
  organization={Springer}
}

Contact

If you have any questions or need further assistance with this dataset, please feel free to contact us: