NimaBoscarino commited on
Commit
32e763a
1 Parent(s): d4b196c

Update LILA.py

Browse files
Files changed (1) hide show
  1. LILA.py +36 -37
LILA.py CHANGED
@@ -106,43 +106,42 @@ class LILA(datasets.GeneratorBasedBuilder):
106
  # TODO: Use ClassLabel for categories...
107
  # TODO: Deal with 404s -> In my manual preprocessing, or in the datasets library?
108
 
109
- match self.config.name:
110
- case 'Caltech Camera Traps':
111
- return datasets.Features({
112
- "id": datasets.Value("string"), "file_name": datasets.Value("string"),
113
- "width": datasets.Value("int32"), "height": datasets.Value("int32"),
114
- "seq_num_frames": datasets.Value("int32"),
115
- "date_captured": datasets.Value("date32"),
116
- "seq_id": datasets.Value("string"),
117
- "location": datasets.Value("string"),
118
- "rights_holder": datasets.Value("string"),
119
- "frame_num": datasets.Value("int32"),
120
-
121
-
122
- "annotations": datasets.Sequence({
123
- "id": datasets.Value("string"),
124
- "category_id": datasets.Value("int32"),
125
- }),
126
-
127
- "bboxes": datasets.Sequence({
128
- "id": datasets.Value("string"),
129
- "category_id": datasets.Value("int32"),
130
- "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
131
- }),
132
-
133
- "image": datasets.Image(decode=False),
134
- })
135
- case 'ENA24':
136
- return datasets.Features({
137
- "id": datasets.Value("string"), "file_name": datasets.Value("string"),
138
- "width": datasets.Value("int32"), "height": datasets.Value("int32"),
139
- "annotations": datasets.Sequence({
140
- "id": datasets.Value("string"),
141
- "category_id": datasets.Value("int32"),
142
- "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
143
- }),
144
- "image": datasets.Image(decode=False),
145
- })
146
 
147
  def _info(self):
148
  features = self._get_features()
 
106
  # TODO: Use ClassLabel for categories...
107
  # TODO: Deal with 404s -> In my manual preprocessing, or in the datasets library?
108
 
109
+ if self.config.name == 'Caltech Camera Traps':
110
+ return datasets.Features({
111
+ "id": datasets.Value("string"), "file_name": datasets.Value("string"),
112
+ "width": datasets.Value("int32"), "height": datasets.Value("int32"),
113
+ "seq_num_frames": datasets.Value("int32"),
114
+ "date_captured": datasets.Value("date32"),
115
+ "seq_id": datasets.Value("string"),
116
+ "location": datasets.Value("string"),
117
+ "rights_holder": datasets.Value("string"),
118
+ "frame_num": datasets.Value("int32"),
119
+
120
+
121
+ "annotations": datasets.Sequence({
122
+ "id": datasets.Value("string"),
123
+ "category_id": datasets.Value("int32"),
124
+ }),
125
+
126
+ "bboxes": datasets.Sequence({
127
+ "id": datasets.Value("string"),
128
+ "category_id": datasets.Value("int32"),
129
+ "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
130
+ }),
131
+
132
+ "image": datasets.Image(decode=False),
133
+ })
134
+ elif self.config.name == 'ENA24':
135
+ return datasets.Features({
136
+ "id": datasets.Value("string"), "file_name": datasets.Value("string"),
137
+ "width": datasets.Value("int32"), "height": datasets.Value("int32"),
138
+ "annotations": datasets.Sequence({
139
+ "id": datasets.Value("string"),
140
+ "category_id": datasets.Value("int32"),
141
+ "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
142
+ }),
143
+ "image": datasets.Image(decode=False),
144
+ })
 
145
 
146
  def _info(self):
147
  features = self._get_features()