keremberke commited on
Commit
9fbbbee
1 Parent(s): b74cb56

dataset uploaded by roboflow2huggingface package

Browse files
README.dataset.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ # Football-Player-Detection > original-raw-images
2
+ https://universe.roboflow.com/augmented-startups/football-player-detection-kucab
3
+
4
+ Provided by a Roboflow user
5
+ License: CC BY 4.0
6
+
README.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ task_categories:
3
+ - object-detection
4
+ tags:
5
+ - roboflow
6
+ ---
7
+
8
+ ### Roboflow Dataset Page
9
+ https://universe.roboflow.com/augmented-startups/football-player-detection-kucab
10
+
11
+ ### Citation
12
+ ```
13
+ football
14
+ ```
15
+
16
+ ### License
17
+ CC BY 4.0
18
+
19
+ ### Dataset Summary
20
+ This dataset was exported via roboflow.com on November 21, 2022 at 6:50 PM GMT
21
+
22
+ Roboflow is an end-to-end computer vision platform that helps you
23
+ * collaborate with your team on computer vision projects
24
+ * collect & organize images
25
+ * understand unstructured image data
26
+ * annotate, and create datasets
27
+ * export, train, and deploy computer vision models
28
+ * use active learning to improve your dataset over time
29
+
30
+ It includes 1232 images.
31
+ Track-players-and-football are annotated in COCO format.
32
+
33
+ The following pre-processing was applied to each image:
34
+ * Auto-orientation of pixel data (with EXIF-orientation stripping)
35
+
36
+ No image augmentation techniques were applied.
37
+
38
+
39
+
README.roboflow.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Football-Player-Detection - v3 original-raw-images
3
+ ==============================
4
+
5
+ This dataset was exported via roboflow.com on November 21, 2022 at 6:50 PM GMT
6
+
7
+ Roboflow is an end-to-end computer vision platform that helps you
8
+ * collaborate with your team on computer vision projects
9
+ * collect & organize images
10
+ * understand unstructured image data
11
+ * annotate, and create datasets
12
+ * export, train, and deploy computer vision models
13
+ * use active learning to improve your dataset over time
14
+
15
+ It includes 1232 images.
16
+ Track-players-and-football are annotated in COCO format.
17
+
18
+ The following pre-processing was applied to each image:
19
+ * Auto-orientation of pixel data (with EXIF-orientation stripping)
20
+
21
+ No image augmentation techniques were applied.
22
+
23
+
data/test.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4040882cd9341cca00c8a7832d7da87a7c731c746466cffbbc8ffd095044e71
3
+ size 11227719
data/train.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6edc725dfb5288b3947fc72d744f1f0717dc5a3ee3906a9c5062f798df3f87ef
3
+ size 75104154
data/valid.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dde7550130d7cda81217655e414d6ac84631472df88a0552985315f53b6764ce
3
+ size 21001802
football-object-detection.py ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import collections
2
+ import json
3
+ import os
4
+
5
+ import datasets
6
+
7
+
8
+ _HOMEPAGE = "https://universe.roboflow.com/augmented-startups/football-player-detection-kucab"
9
+ _LICENSE = "CC BY 4.0"
10
+ _CITATION = """\
11
+ football
12
+ """
13
+ _URLS = {
14
+ "train": "https://huggingface.co/datasets/keremberke/football-object-detection/resolve/main/data/train.zip",
15
+ "validation": "https://huggingface.co/datasets/keremberke/football-object-detection/resolve/main/data/valid.zip",
16
+ "test": "https://huggingface.co/datasets/keremberke/football-object-detection/resolve/main/data/test.zip",
17
+ }
18
+
19
+ _CATEGORIES = ['player', 'football']
20
+ _ANNOTATION_FILENAME = "_annotations.coco.json"
21
+
22
+
23
+ class FOOTBALLOBJECTDETECTION(datasets.GeneratorBasedBuilder):
24
+ VERSION = datasets.Version("1.0.0")
25
+
26
+ def _info(self):
27
+ features = datasets.Features(
28
+ {
29
+ "image_id": datasets.Value("int64"),
30
+ "image": datasets.Image(),
31
+ "width": datasets.Value("int32"),
32
+ "height": datasets.Value("int32"),
33
+ "objects": datasets.Sequence(
34
+ {
35
+ "id": datasets.Value("int64"),
36
+ "area": datasets.Value("int64"),
37
+ "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
38
+ "category": datasets.ClassLabel(names=_CATEGORIES),
39
+ }
40
+ ),
41
+ }
42
+ )
43
+ return datasets.DatasetInfo(
44
+ features=features,
45
+ homepage=_HOMEPAGE,
46
+ citation=_CITATION,
47
+ license=_LICENSE,
48
+ )
49
+
50
+ def _split_generators(self, dl_manager):
51
+ data_files = dl_manager.download_and_extract(_URLS)
52
+ return [
53
+ datasets.SplitGenerator(
54
+ name=datasets.Split.TRAIN,
55
+ gen_kwargs={
56
+ "folder_dir": data_files["train"],
57
+ },
58
+ ),
59
+ datasets.SplitGenerator(
60
+ name=datasets.Split.VALIDATION,
61
+ gen_kwargs={
62
+ "folder_dir": data_files["validation"],
63
+ },
64
+ ),
65
+ datasets.SplitGenerator(
66
+ name=datasets.Split.TEST,
67
+ gen_kwargs={
68
+ "folder_dir": data_files["test"],
69
+ },
70
+ ),
71
+ ]
72
+
73
+ def _generate_examples(self, folder_dir):
74
+ def process_annot(annot, category_id_to_category):
75
+ return {
76
+ "id": annot["id"],
77
+ "area": annot["area"],
78
+ "bbox": annot["bbox"],
79
+ "category": category_id_to_category[annot["category_id"]],
80
+ }
81
+
82
+ image_id_to_image = {}
83
+ idx = 0
84
+
85
+ annotation_filepath = os.path.join(folder_dir, _ANNOTATION_FILENAME)
86
+ with open(annotation_filepath, "r") as f:
87
+ annotations = json.load(f)
88
+ category_id_to_category = {category["id"]: category["name"] for category in annotations["categories"]}
89
+ image_id_to_annotations = collections.defaultdict(list)
90
+ for annot in annotations["annotations"]:
91
+ image_id_to_annotations[annot["image_id"]].append(annot)
92
+ image_id_to_image = {annot["file_name"]: annot for annot in annotations["images"]}
93
+
94
+ for filename in os.listdir(folder_dir):
95
+ filepath = os.path.join(folder_dir, filename)
96
+ if filename in image_id_to_image:
97
+ image = image_id_to_image[filename]
98
+ objects = [
99
+ process_annot(annot, category_id_to_category) for annot in image_id_to_annotations[image["id"]]
100
+ ]
101
+ with open(filepath, "rb") as f:
102
+ image_bytes = f.read()
103
+ yield idx, {
104
+ "image_id": image["id"],
105
+ "image": {"path": filepath, "bytes": image_bytes},
106
+ "width": image["width"],
107
+ "height": image["height"],
108
+ "objects": objects,
109
+ }
110
+ idx += 1