CoolFace
Datasetpublic

JackFurby/playing-cards

Dataset Card for Playing cards Dataset Description Dataset Summary A dataset containing four sets of playing card images. Each set contains 10,000 images and has a series of attributes. Cards are randomly rotated, flipped and scaled (within limits). Train and test splits are provided in both JSON and pickle formats. Concept and task classification labels (both zero indexed) and names are provided in txt files. Dataset Structure… See the full description on the dataset page: https://huggingface.co/datasets/JackFurby/playing-cards.

sourceHugging Facemitupdated 3y agoView on Hugging Face
1likes301downloads
Dataset Card

Dataset Card for Playing cards

Table of Contents

Dataset Description

Dataset Summary

A dataset containing four sets of playing card images. Each set contains 10,000 images and has a series of attributes. Cards are randomly rotated, flipped and scaled (within limits).

Train and test splits are provided in both JSON and pickle formats. Concept and task classification labels (both zero indexed) and names are provided in txt files.

Dataset Structure

Data Instances

Each set of samples have the following:

  • —A set number of playing cards in each sample
  • —A list of concepts present in the each sample (1 for concepts present and 0 otherwise)
  • —The task classification label
  • —coordinates for each of the corners of playing cards in each sample.

The basic structure of the JSON and pkl files describing each sample is as follows:

sample ID, {
	'img_path': string file path,
	'concept_label': list of 0s and 1s,
	'class_label': integer,
	'card_points': list of tuples and card class labels as integers
}
Single

Single playing card on a random background.

  • —Number of playing cards: 1
  • —Concepts: Suit and rank
  • —Class label: Card classification
  • —Card points: Coordinates of the card and card classification
Example
1599, {
	'img_path': 'imgs/single/1599.png',
	'concept_label': [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
	'class_label': 11,
	'card_points': [[[(657, 517), (405, 609), (520, 139), (268, 231)], 11]]
}
Three

Three randomly selected playing cards on a random background. Class label is set to hand rank for the game Three card poker.

  • —Number of playing cards: 3
  • —Concepts: Cards present
  • —Class label: Hand rank
  • —Card points: Coordinates of the cards and card classifications
Example
5159, {
	'img_path': 'imgs/three/5159.png',
	'concept_label': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
	'class_label': 4,
	'card_points': [[[(35, 517), (68, 374), (250, 567), (283, 424)], 15], [[(70, 364), (103, 221), (285, 413), (318, 270)], 24], [[(106, 210), (139, 67), (321, 260), (354, 117)], 13]]
}
Three card poker

Three playing cards on a random background. Class label is set to hand rank for the game Three card poker.

  • —Number of playing cards: 3
  • —Concepts: Cards present
  • —Class label: Hand rank
  • —Card points: Coordinates of the cards and card classifications
Example
9259, {
	'img_path': 'imgs/three_card_poker/9259.png',
	'concept_label': [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
	'class_label': 4,
	'card_points': [[[(42, 478), (84, 347), (237, 541), (279, 411)], 8], [[(325, 271), (282, 401), (129, 208), (87, 338)], 13], [[(370, 132), (328, 262), (175, 68), (133, 198)], 10]]
}
Class-level Three card poker

Three playing cards on a random background. Class label is set to hand rank for the game Three card poker. This set of samples have concepts set to the class. Every instance of the same class will have the same concept vector.

  • —Number of playing cards: 3
  • —Concepts: Cards present
  • —Class label: Hand rank
  • —Card points: Coordinates of the cards and card classifications
Example
5992, {
	'img_path': 'imgs/three_card_poker_class_level/5992.png',
	'concept_label': [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1],
	'class_label': 5,
	'card_points': [[[(539, 98), (574, 247), (317, 150), (351, 298)], 5], [[(388, 457), (354, 309), (610, 406), (576, 257)], 10], [[(613, 416), (647, 565), (390, 468), (425, 616)], 7]]
}

Data Fields

  • —String file path from the root of the dataset to a given samples image file
  • —A list of concepts present in the each sample (1 for concepts present and 0 otherwise). The index of each value in this list corresponds to the label in concepts.txt.
  • —The task classification label. This corresponds the the label in classes.txt
  • —list of playing cards present in a given sample. Each item in the list has a list of card coordinates (card coordinates are always in the order top left, top right, bottom left, bottom right) and the card classification label, either corresponding to concepts.txt for images with three cards per image or classes.txt for images with a single card present.

Data Splits

Single
Task classifications
Class nameCount trainCount val
2C13558
2D13558
2H13558
2S13558
3C13558
3D13558
3H13558
3S13558
4C13558
4D13558
4H13558
4S13558
5C13558
5D13558
5H13558
5S13558
6C13458
6D13458
6H13458
6S13458
7C13458
7D13458
7H13458
7S13458
8C13458
8D13458
8H13458
8S13458
9C13458
9D13458
9H13458
9S13458
10C13458
10D13458
10H13458
10S13458
JC13458
JD13458
JH13458
JS13458
QC13458
QD13458
QH13458
QS13458
KC13458
KD13458
KH13458
KS13458
Concepts
Concept nameCount trainCount val
2540232
3540232
4540232
5540232
6536232
7536232
8536232
9536232
10536232
J536232
Q536232
K536232
A536232
C1746754
D1746754
H1746754
S1746754
Three
Task classification
Class nameCount trainCount val
straight_flush202
threeofa_kind1711
straight26899
flush332149
pair1171524
high_card51912216
Concepts
Concept nameCount trainCount val
2C398181
2D441161
2H385143
2S397170
3C439171
3D383165
3H398181
3S435179
4C407164
4D402179
4H409168
4S403191
5C402150
5D373173
5H383187
5S426178
6C394176
6D414172
6H398184
6S413163
7C409171
7D412158
7H391185
7S453176
8C390171
8D398171
8H406148
8S368193
9C381187
9D429167
9H391193
9S370174
10C450171
10D420161
10H436180
10S406169
JC416160
JD411176
JH409182
JS404178
QC403171
QD376185
QH407182
QS420156
KC414180
KD384176
KH377157
KS382192
AC348168
AD408177
AH427174
AS401178
Three card poker
Task classification
Class nameCount trainCount val
straight_flush1166501
threeofa_kind1166501
straight1166501
flush1166501
pair1166500
high_card1166500
Concepts
Concept nameCount trainCount val
2C344171
2D368181
2H386161
2S359163
3C400186
3D421181
3H414181
3S407172
4C409185
4D388199
4H408185
4S411195
5C403176
5D409191
5H401198
5S392206
6C422177
6D405194
6H444161
6S412175
7C420181
7D404189
7H429156
7S433158
8C422173
8D436159
8H412167
8S431166
9C407186
9D405174
9H432169
9S398185
10C416164
10D413174
10H430171
10S402176
JC431170
JD462158
JH443145
JS405186
QC401186
QD432163
QH419187
QS397172
KC363157
KD358178
KH367157
KS364155
AC380155
AD363151
AH359150
AS351156
Class-level Three card poker
Task classification
Class nameCount trainCount val
straight_flush1166501
threeofa_kind1166501
straight1166501
flush1166501
pair1166500
high_card1166500
Concepts
Concept nameCount trainCount val
2H1166501
3H23321002
4C23321002
4D23321002
4H1166501
4S23321001
5C1166500
5D34981501
6D1166501
9D1166501
10H23321000

Dataset Creation

Curation Rationale

This dataset was created to test Concept Bottleneck Models [1] with instance and class level concepts.

Source Data

Initial Data Collection and Normalization

The dataset uses background from [2] and playing card images from [3]. The dataset is balanced to the task classification labels with concepts, backgrounds and card transformations being applied randomly. The code used to generate the dataset is available here [4].

Annotations

Annotation process

The annotation process was completed during the generation of the dataset.

Who are the annotators?

Annotations were completed by a machine.

Personal and Sensitive Information

This dataset does not contain personal and sensitive Information.

Additional Information

Licensing Information

This dataset is licenced with the MIT licence.

Citation Information

[1] Koh, P.W., Nguyen, T., Tang, Y.S., Mussmann, S., Pierson, E., Kim, B. & Liang, P.. (2020). Concept Bottleneck Models. Proceedings of the 37th International Conference on Machine Learning, in Proceedings of Machine Learning Research 119:5338-5348 Available from https://proceedings.mlr.press/v119/koh20a.html.

[2] M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed and A. Vedaldi, "Describing Textures in the Wild," 2014 IEEE Conference on Computer Vision and Pattern Recognition, 2014, pp. 3606-3613, doi: 10.1109/CVPR.2014.461.

[3] j4p4n, "Full Deck Of Ornate Playing Cards - English", Available at: https://openclipart.org/download/315253/1550166858.svg

[4] J. Furby, "playing-card-concept-generator", Available at: https://github.com/JackFurby/playing-card-concept-generator

JackFurby/playing-cards · CoolFace