region:us
---
dataset_info:
  features:
  - name: image
    dtype: image
  - name: image_seg
    dtype: image
  - name: landmarks
    dtype: string
  - name: spiga
    sequence:
      sequence: float64
  - name: spiga_seg
    dtype: image
  - name: image_caption
    dtype: string
  splits:
  - name: train
    num_bytes: 31087489990.0
    num_examples: 100000
  download_size: 31011261945
  dataset_size: 31087489990.0
---
# Dataset Card for "face_synthetics_spiga_captioned"

This is a copy of the [Microsoft FaceSynthetics dataset with SPIGA-calculated landmark annotations](https://huggingface.co/datasets/pcuenq/face_synthetics_spiga), and additional BLIP-generated captions. 
For a copy of the original FaceSynthetics dataset with no extra annotations, please refer to [pcuenq/face_synthetics](https://huggingface.co/datasets/pcuenq/face_synthetics).

Here is the code for parsing the dataset and generating the BLIP captions:
```py
from transformers import pipeline

dataset_name = "pcuenq/face_synthetics_spiga"
faces = load_dataset(dataset_name)
faces = faces["train"]

captioner = pipeline("image-to-text",model="Salesforce/blip-image-captioning-large", device=0)

def caption_image_data(example):
    image = example["image"]
    image_caption = captioner(image)[0]['generated_text']
    example['image_caption'] = image_caption
    return example

faces_proc = faces.map(caption_image_data)
faces_proc.push_to_hub(f"multimodalart/face_synthetics_spiga_captioned")
```
