A PyTorch dataset of the eyes found in the OmniArt dataset
Project description
OmniArt Eye Dataset
This package provides a dataset of 118,576 painted eyes. These eyes are extracted from about 245,000 paintings from the OmniArt dataset. The dataset provides the eyes as images, the colour of the iris, and metadata from the OmniArt dataset.
Usage
The dataset can be used like any other PyTorch dataset. It extends the ImageFolder
class to provide the images and labels/colour and in addition attaches the OmniArt metadata as a dictionary.
The following classes are used, and how many of that class exist in the dataset:
Colour | Count |
---|---|
Amber | 3,114 |
Blue | 18,926 |
Brown | 42,094 |
Gray | 7,637 |
Grayscale | 16,234 |
Green | 5,220 |
Hazel | 1,578 |
Irisless | 18,282 |
Negative | 96,042 |
Red | 5,491 |
The negative
class exists to be able to classify non-eye images. It contains samples of primarily noise and facial areas, such as closed eyelids.
Example
The dataset can be used in the following way
import torch
import matplotlib.pyplot as plt
import numpy as np
import torchvision.utils as vutils
from torchvision.transforms import transforms
from omniart_eye_dataset import OmniArtEyeDataset
dataset = OmniArtEyeDataset(transform=transforms.Compose([
transforms.Resize(50),
transforms.CenterCrop(50),
transforms.ToTensor(),
]))
dataloader = torch.utils.data.DataLoader(dataset, batch_size=64, shuffle=True, num_workers=4)
# Take 64 random entries
images, color, metadata = next(iter(dataloader))
# Plot the entries
plt.figure(figsize=(10, 10))
plt.axis("off")
plt.title("OmniArt eyes")
plt.imshow(np.transpose(vutils.make_grid(images, padding=5, normalize=True), (1, 2, 0)))
plt.show()
Related
This dataset has already been used to train a classifier and painted eye generator.
Project origin
This package is part of a Master's thesis at the University of Amsterdam.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file omniart_eye_dataset-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: omniart_eye_dataset-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb74f2f0d0565e071fe25176730e04948a20f21737e7045a2114bd5c4b9e7598 |
|
MD5 | 61d1100574147d5ab7314a5ef09f38f9 |
|
BLAKE2b-256 | 5cd881ffead1b59506e2c9fa4a9d6d9dec58ba25035db11dc3855f2ccfe05555 |