SIA86 commited on
Commit
5c4e1b6
·
1 Parent(s): 3847d94

Update WaterFlowCountersRecognition.py

Browse files
Files changed (1) hide show
  1. WaterFlowCountersRecognition.py +15 -16
WaterFlowCountersRecognition.py CHANGED
@@ -61,20 +61,18 @@ class WaterFlowCounter(datasets.GeneratorBasedBuilder):
61
  def _info(self):
62
  features = datasets.Features(
63
  {
64
- "image_id": datasets.Value("int32"),
65
  "image": datasets.Image(),
66
- "width": datasets.Value('int32'),
67
- "height": datasets.Value('int32'),
68
  "objects": datasets.Sequence(
69
- {
70
- "id": datasets.Value('int32'),
71
- "bbox": datasets.Sequence(datasets.Value("int64"), length=4),
72
- "area": datasets.Value("int64"),
73
- "segmentation": datasets.Sequence(datasets.Sequence(datasets.Value("int64"))),
74
- "name": datasets.ClassLabel(names=_REGION_NAME, num_classes=3),
75
- "rotated": datasets.ClassLabel(names=_REGION_ROTETION, num_classes=4)
76
- }
77
- )
78
  }
79
  )
80
 
@@ -163,12 +161,15 @@ class WaterFlowCounter(datasets.GeneratorBasedBuilder):
163
 
164
  for name in list(region['region_attributes']['name'].keys()):
165
  names.append(name_to_id[name])
 
166
  try:
167
  for rot in list(region['region_attributes']['rotated'].keys()):
168
  rotated.append(rotation_to_id[rot])
169
  except:
170
  rotated.append(int(region['region_attributes']['rotated']))
171
 
 
 
172
 
173
  yield idx, {
174
  "image_id": idx,
@@ -178,10 +179,8 @@ class WaterFlowCounter(datasets.GeneratorBasedBuilder):
178
  "objects": {
179
  "id": ids,
180
  "area": all_area,
181
- "bbox": all_bbox,
182
- "segmentation": all_segmentation,
183
- "name":names,
184
- "rotated": rotated
185
  }
186
  }
187
  idx += 1
 
61
  def _info(self):
62
  features = datasets.Features(
63
  {
64
+ "image_id": datasets.Value("int64"),
65
  "image": datasets.Image(),
66
+ "width": datasets.Value("int32"),
67
+ "height": datasets.Value("int32"),
68
  "objects": datasets.Sequence(
69
+ {
70
+ "id": datasets.Value("int64"),
71
+ "area": datasets.Value("int64"),
72
+ "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
73
+ "category": datasets.ClassLabel(names=_REGION_NAME),
74
+ }
75
+ ),
 
 
76
  }
77
  )
78
 
 
161
 
162
  for name in list(region['region_attributes']['name'].keys()):
163
  names.append(name_to_id[name])
164
+ '''
165
  try:
166
  for rot in list(region['region_attributes']['rotated'].keys()):
167
  rotated.append(rotation_to_id[rot])
168
  except:
169
  rotated.append(int(region['region_attributes']['rotated']))
170
 
171
+ '''
172
+
173
 
174
  yield idx, {
175
  "image_id": idx,
 
179
  "objects": {
180
  "id": ids,
181
  "area": all_area,
182
+ "bbox": all_bbox,
183
+ "cathegory":names,
 
 
184
  }
185
  }
186
  idx += 1