qgyd2021 commited on
Commit
bf3f8bb
1 Parent(s): 7b08781

[update]add data

Browse files
cppe5.py CHANGED
@@ -96,7 +96,6 @@ class CPPE5(datasets.GeneratorBasedBuilder):
96
  sample = json.loads(row)
97
 
98
  file_path = sample["image"]
99
- file_path = os.path.join("data/images", file_path)
100
  file_path = dl_manager.download(file_path)
101
 
102
  with open(file_path, "rb") as image_f:
 
96
  sample = json.loads(row)
97
 
98
  file_path = sample["image"]
 
99
  file_path = dl_manager.download(file_path)
100
 
101
  with open(file_path, "rb") as image_f:
data/annotations/test.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:737574a0327b3091b4fdee0ad118006b03b05fec980073fef48c838e03dfd294
3
- size 18562
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dd85c9919bcd33ab761b7ff40024a8bdc81dc936cb30007de267d712c6fd448
3
+ size 18910
data/annotations/train.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7f429504dc386f9d489dcbf5a66de99b0b89c7b560a5ba58af55b28ed7984845
3
- size 438728
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f59a6b1993501b30cb916d7faf9d5e11c549bc3de98399a32ec3a1e85f60540a
3
+ size 450728
examples/make_jsonl.py CHANGED
@@ -2,6 +2,8 @@
2
  # -*- coding: utf-8 -*-
3
  from collections import defaultdict
4
  import json
 
 
5
 
6
  from project_settings import project_path
7
 
@@ -30,14 +32,17 @@ def main():
30
  image_id = annotation["image_id"]
31
  image_id_to_annotations[image_id].append(annotation)
32
 
33
- with open("{}.jsonl".format(subset), "w", encoding="utf-8") as f:
 
34
  for image in images:
35
  image_id = image["id"]
36
  annotations = image_id_to_annotations[image_id]
37
 
 
 
38
  row = {
39
  "image_id": image["id"],
40
- "image": image["file_name"],
41
  "width": image["width"],
42
  "height": image["height"],
43
  "objects": [
 
2
  # -*- coding: utf-8 -*-
3
  from collections import defaultdict
4
  import json
5
+ import os
6
+ from pathlib import Path
7
 
8
  from project_settings import project_path
9
 
 
32
  image_id = annotation["image_id"]
33
  image_id_to_annotations[image_id].append(annotation)
34
 
35
+ to_filename = project_path / "data/annotations/{}.jsonl".format(subset)
36
+ with open(to_filename.as_posix(), "w", encoding="utf-8") as f:
37
  for image in images:
38
  image_id = image["id"]
39
  annotations = image_id_to_annotations[image_id]
40
 
41
+ image_path = Path("data/images") / image["file_name"]
42
+
43
  row = {
44
  "image_id": image["id"],
45
+ "image": image_path.as_posix(),
46
  "width": image["width"],
47
  "height": image["height"],
48
  "objects": [