keremberke commited on
Commit
77828c0
1 Parent(s): 5353a88

dataset uploaded by roboflow2huggingface package

Browse files
README.md CHANGED
@@ -3,12 +3,50 @@ task_categories:
3
  - object-detection
4
  tags:
5
  - roboflow
 
 
6
  ---
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ### Roboflow Dataset Page
9
- [https://universe.roboflow.com/asd-culfr/wlots](https://universe.roboflow.com/asd-culfr/wlots?ref=roboflow2huggingface)
10
 
11
  ### Citation
 
12
  ```
13
  @misc{ wlots_dataset,
14
  title = { wlots Dataset },
@@ -20,7 +58,7 @@ tags:
20
  publisher = { Roboflow },
21
  year = { 2022 },
22
  month = { may },
23
- note = { visited on 2022-12-29 },
24
  }
25
  ```
26
 
 
3
  - object-detection
4
  tags:
5
  - roboflow
6
+ - roboflow2huggingface
7
+
8
  ---
9
 
10
+ <div align="center">
11
+ <img width="640" alt="keremberke/csgo-object-detection" src="https://huggingface.co/datasets/keremberke/csgo-object-detection/resolve/main/thumbnail.jpg">
12
+ </div>
13
+
14
+ ### Dataset Labels
15
+
16
+ ```
17
+ ['ct', 'cthead', 't', 'thead']
18
+ ```
19
+
20
+
21
+ ### Number of Images
22
+
23
+ ```json
24
+ {'train': 3879, 'valid': 383, 'test': 192}
25
+ ```
26
+
27
+
28
+ ### How to Use
29
+
30
+ - Install [datasets](https://pypi.org/project/datasets/):
31
+
32
+ ```bash
33
+ pip install datasets
34
+ ```
35
+
36
+ - Load the dataset:
37
+
38
+ ```python
39
+ from datasets import load_dataset
40
+
41
+ ds = load_dataset("keremberke/csgo-object-detection", name="full")
42
+ example = ds['train'][0]
43
+ ```
44
+
45
  ### Roboflow Dataset Page
46
+ [https://universe.roboflow.com/asd-culfr/wlots/dataset/1](https://universe.roboflow.com/asd-culfr/wlots/dataset/1?ref=roboflow2huggingface)
47
 
48
  ### Citation
49
+
50
  ```
51
  @misc{ wlots_dataset,
52
  title = { wlots Dataset },
 
58
  publisher = { Roboflow },
59
  year = { 2022 },
60
  month = { may },
61
+ note = { visited on 2023-01-27 },
62
  }
63
  ```
64
 
csgo-object-detection.py CHANGED
@@ -5,7 +5,7 @@ import os
5
  import datasets
6
 
7
 
8
- _HOMEPAGE = "https://universe.roboflow.com/asd-culfr/wlots"
9
  _LICENSE = "CC BY 4.0"
10
  _CITATION = """\
11
  @misc{ wlots_dataset,
@@ -18,21 +18,52 @@ _CITATION = """\
18
  publisher = { Roboflow },
19
  year = { 2022 },
20
  month = { may },
21
- note = { visited on 2022-12-29 },
22
  }
23
  """
24
- _URLS = {
25
- "train": "https://huggingface.co/datasets/keremberke/csgo-object-detection/resolve/main/data/train.zip",
26
- "validation": "https://huggingface.co/datasets/keremberke/csgo-object-detection/resolve/main/data/valid.zip",
27
- "test": "https://huggingface.co/datasets/keremberke/csgo-object-detection/resolve/main/data/test.zip",
28
- }
29
-
30
- _CATEGORIES = ['thead', 't', 'cthead', 'ct']
31
  _ANNOTATION_FILENAME = "_annotations.coco.json"
32
 
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  class CSGOOBJECTDETECTION(datasets.GeneratorBasedBuilder):
 
 
35
  VERSION = datasets.Version("1.0.0")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  def _info(self):
38
  features = datasets.Features(
@@ -59,7 +90,7 @@ class CSGOOBJECTDETECTION(datasets.GeneratorBasedBuilder):
59
  )
60
 
61
  def _split_generators(self, dl_manager):
62
- data_files = dl_manager.download_and_extract(_URLS)
63
  return [
64
  datasets.SplitGenerator(
65
  name=datasets.Split.TRAIN,
@@ -92,7 +123,7 @@ class CSGOOBJECTDETECTION(datasets.GeneratorBasedBuilder):
92
 
93
  image_id_to_image = {}
94
  idx = 0
95
-
96
  annotation_filepath = os.path.join(folder_dir, _ANNOTATION_FILENAME)
97
  with open(annotation_filepath, "r") as f:
98
  annotations = json.load(f)
@@ -100,12 +131,12 @@ class CSGOOBJECTDETECTION(datasets.GeneratorBasedBuilder):
100
  image_id_to_annotations = collections.defaultdict(list)
101
  for annot in annotations["annotations"]:
102
  image_id_to_annotations[annot["image_id"]].append(annot)
103
- image_id_to_image = {annot["file_name"]: annot for annot in annotations["images"]}
104
 
105
  for filename in os.listdir(folder_dir):
106
  filepath = os.path.join(folder_dir, filename)
107
- if filename in image_id_to_image:
108
- image = image_id_to_image[filename]
109
  objects = [
110
  process_annot(annot, category_id_to_category) for annot in image_id_to_annotations[image["id"]]
111
  ]
 
5
  import datasets
6
 
7
 
8
+ _HOMEPAGE = "https://universe.roboflow.com/asd-culfr/wlots/dataset/1"
9
  _LICENSE = "CC BY 4.0"
10
  _CITATION = """\
11
  @misc{ wlots_dataset,
 
18
  publisher = { Roboflow },
19
  year = { 2022 },
20
  month = { may },
21
+ note = { visited on 2023-01-27 },
22
  }
23
  """
24
+ _CATEGORIES = ['ct', 'cthead', 't', 'thead']
 
 
 
 
 
 
25
  _ANNOTATION_FILENAME = "_annotations.coco.json"
26
 
27
 
28
+ class CSGOOBJECTDETECTIONConfig(datasets.BuilderConfig):
29
+ """Builder Config for csgo-object-detection"""
30
+
31
+ def __init__(self, data_urls, **kwargs):
32
+ """
33
+ BuilderConfig for csgo-object-detection.
34
+
35
+ Args:
36
+ data_urls: `dict`, name to url to download the zip file from.
37
+ **kwargs: keyword arguments forwarded to super.
38
+ """
39
+ super(CSGOOBJECTDETECTIONConfig, self).__init__(version=datasets.Version("1.0.0"), **kwargs)
40
+ self.data_urls = data_urls
41
+
42
+
43
  class CSGOOBJECTDETECTION(datasets.GeneratorBasedBuilder):
44
+ """csgo-object-detection object detection dataset"""
45
+
46
  VERSION = datasets.Version("1.0.0")
47
+ BUILDER_CONFIGS = [
48
+ CSGOOBJECTDETECTIONConfig(
49
+ name="full",
50
+ description="Full version of csgo-object-detection dataset.",
51
+ data_urls={
52
+ "train": "https://huggingface.co/datasets/keremberke/csgo-object-detection/resolve/main/data/train.zip",
53
+ "validation": "https://huggingface.co/datasets/keremberke/csgo-object-detection/resolve/main/data/valid.zip",
54
+ "test": "https://huggingface.co/datasets/keremberke/csgo-object-detection/resolve/main/data/test.zip",
55
+ },
56
+ ),
57
+ CSGOOBJECTDETECTIONConfig(
58
+ name="mini",
59
+ description="Mini version of csgo-object-detection dataset.",
60
+ data_urls={
61
+ "train": "https://huggingface.co/datasets/keremberke/csgo-object-detection/resolve/main/data/valid-mini.zip",
62
+ "validation": "https://huggingface.co/datasets/keremberke/csgo-object-detection/resolve/main/data/valid-mini.zip",
63
+ "test": "https://huggingface.co/datasets/keremberke/csgo-object-detection/resolve/main/data/valid-mini.zip",
64
+ },
65
+ )
66
+ ]
67
 
68
  def _info(self):
69
  features = datasets.Features(
 
90
  )
91
 
92
  def _split_generators(self, dl_manager):
93
+ data_files = dl_manager.download_and_extract(self.config.data_urls)
94
  return [
95
  datasets.SplitGenerator(
96
  name=datasets.Split.TRAIN,
 
123
 
124
  image_id_to_image = {}
125
  idx = 0
126
+
127
  annotation_filepath = os.path.join(folder_dir, _ANNOTATION_FILENAME)
128
  with open(annotation_filepath, "r") as f:
129
  annotations = json.load(f)
 
131
  image_id_to_annotations = collections.defaultdict(list)
132
  for annot in annotations["annotations"]:
133
  image_id_to_annotations[annot["image_id"]].append(annot)
134
+ filename_to_image = {image["file_name"]: image for image in annotations["images"]}
135
 
136
  for filename in os.listdir(folder_dir):
137
  filepath = os.path.join(folder_dir, filename)
138
+ if filename in filename_to_image:
139
+ image = filename_to_image[filename]
140
  objects = [
141
  process_annot(annot, category_id_to_category) for annot in image_id_to_annotations[image["id"]]
142
  ]
data/test.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fd5b254e5840a3c8f560bf0b27c2e175dffea93c2d3cb99f94108fa04fead5af
3
  size 4941492
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a33579748c42906bb0ad8fcfd2ac2f228fb4acd376bd79d311d651988ccdfd9
3
  size 4941492
data/train.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b30e5753bf1fa91af52d9af058888a75243aa7442433258b5fce1d2730fe5dc0
3
  size 101266440
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7a966a8cf212af4b67ccda7a88b1cd310e56ec6a2c0f39722fb526bde22deb0
3
  size 101266440
data/valid-mini.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4f76923d3d48556eed8af37ee2a4038028e57177055d1a2e3baf968173b75dc
3
+ size 62543
data/valid.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:79421a3a866a7ae8a179ac72a51a507aa30feb58cc2541ba487b95b341ac5602
3
  size 10147480
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da489358563946e6252d9dc6da95cb2ec7d4483f12f6966b5fc3219a0a1e2622
3
  size 10147480
split_name_to_num_samples.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"train": 3879, "valid": 383, "test": 192}
thumbnail.jpg ADDED

Git LFS Details

  • SHA256: 15ef402305a54f757dba64e4c60acb65d0f9f789015869cc07cfe0aec1ace7a0
  • Pointer size: 131 Bytes
  • Size of remote file: 121 kB