nvm472001 commited on
Commit
7a27876
·
1 Parent(s): f87d19a

Update cvdataset-layoutlmv3.py

Browse files
Files changed (1) hide show
  1. cvdataset-layoutlmv3.py +10 -8
cvdataset-layoutlmv3.py CHANGED
@@ -19,7 +19,7 @@ def normalize_bbox(bbox, size):
19
  int(1000 * bbox[0] / size[0]),
20
  int(1000 * bbox[1] / size[1]),
21
  int(1000 * bbox[2] / size[0]),
22
- int(100 * bbox[3] / size[1]),
23
  ]
24
 
25
  def _get_drive_url(url):
@@ -80,16 +80,18 @@ class CVDS(datasets.GeneratorBasedBuilder):
80
  )
81
 
82
  def _split_generators(self, dl_manager):
83
- download_file = dl_manager.download_and_extract(_URLS)
84
- dest = Path(download_file[0])/"data1"
85
-
 
 
86
  return [
87
  datasets.SplitGenerator(
88
- name=datasets.Split.TRAIN, gen_kwargs={ "filepath": dest/"train.txt", "dest": dest }
89
- ),
90
  datasets.SplitGenerator(
91
- name=datasets.Split.TEST, gen_kwargs={ "filepath": dest/"test.txt", "dest": dest}
92
- )
93
  ]
94
 
95
  def _generate_examples(self, file_path, dest):
 
19
  int(1000 * bbox[0] / size[0]),
20
  int(1000 * bbox[1] / size[1]),
21
  int(1000 * bbox[2] / size[0]),
22
+ int(1000 * bbox[3] / size[1]),
23
  ]
24
 
25
  def _get_drive_url(url):
 
80
  )
81
 
82
  def _split_generators(self, dl_manager):
83
+ """Returns SplitGenerators."""
84
+ """Uses local files located with data_dir"""
85
+ downloaded_file = dl_manager.download_and_extract(_URLS)
86
+ dest = Path(downloaded_file[0])/'data1'
87
+
88
  return [
89
  datasets.SplitGenerator(
90
+ name=datasets.Split.TRAIN, gen_kwargs={"filepath": dest/"train.txt", "dest": dest}
91
+ ),
92
  datasets.SplitGenerator(
93
+ name=datasets.Split.TEST, gen_kwargs={"filepath": dest/"test.txt", "dest": dest}
94
+ ),
95
  ]
96
 
97
  def _generate_examples(self, file_path, dest):