qgyd2021 commited on
Commit
e6e2efb
1 Parent(s): e8bd074

[update]add data

Browse files
Files changed (1) hide show
  1. cppe5.py → cppe-5.py +10 -10
cppe5.py → cppe-5.py RENAMED
@@ -47,12 +47,12 @@ class CPPE5(datasets.GeneratorBasedBuilder):
47
  "width": datasets.Value("int32"),
48
  "height": datasets.Value("int32"),
49
  "objects": datasets.Sequence(
50
- {
51
  "id": datasets.Value("int64"),
52
  "area": datasets.Value("int64"),
53
  "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
54
  "category": datasets.ClassLabel(names=_CATEGORIES),
55
- }
56
  ),
57
  }
58
  )
@@ -103,14 +103,14 @@ class CPPE5(datasets.GeneratorBasedBuilder):
103
  image_bytes = image_f.read()
104
  # image = Image.open(image_f)
105
 
106
- yield idx, {
107
- "image_id": sample["image_id"],
108
- "image": {"path": file_path, "bytes": image_bytes},
109
- # "image": image,
110
- "width": sample["width"],
111
- "height": sample["height"],
112
- "objects": sample["objects"],
113
- }
114
  idx += 1
115
 
116
 
 
47
  "width": datasets.Value("int32"),
48
  "height": datasets.Value("int32"),
49
  "objects": datasets.Sequence(
50
+ feature=datasets.Features({
51
  "id": datasets.Value("int64"),
52
  "area": datasets.Value("int64"),
53
  "bbox": datasets.Sequence(datasets.Value("float32"), length=4),
54
  "category": datasets.ClassLabel(names=_CATEGORIES),
55
+ })
56
  ),
57
  }
58
  )
 
103
  image_bytes = image_f.read()
104
  # image = Image.open(image_f)
105
 
106
+ yield idx, {
107
+ "image_id": sample["image_id"],
108
+ "image": {"path": file_path, "bytes": image_bytes},
109
+ # "image": image,
110
+ "width": sample["width"],
111
+ "height": sample["height"],
112
+ "objects": sample["objects"],
113
+ }
114
  idx += 1
115
 
116