fixed bug
Browse files- ref_seg_ger.py +5 -3
ref_seg_ger.py
CHANGED
|
@@ -205,10 +205,10 @@ class RefSeg(datasets.GeneratorBasedBuilder):
|
|
| 205 |
#print(filepath)
|
| 206 |
#print(split)
|
| 207 |
paths = glob(filepath + '/' + split + '/*.csv')
|
| 208 |
-
|
| 209 |
key = 0
|
| 210 |
for f in paths:
|
| 211 |
-
|
| 212 |
df = pd.read_csv(f)
|
| 213 |
input_ids = []
|
| 214 |
labels = []
|
|
@@ -245,13 +245,15 @@ class RefSeg(datasets.GeneratorBasedBuilder):
|
|
| 245 |
else:
|
| 246 |
continue
|
| 247 |
|
| 248 |
-
|
| 249 |
for chunk_id, index in enumerate(range(0, len(input_ids), self.CHUNK_SIZE)):
|
| 250 |
split_ids = input_ids[index:max(len(input_ids), index + self.CHUNK_SIZE)]
|
| 251 |
#split_bboxes = bboxes[index:index + self.CHUNK_SIZE]
|
| 252 |
# split_rgbs = rgbs[index:index + self.CHUNK_SIZE]
|
| 253 |
# split_fonts = fonts[index:index + self.CHUNK_SIZE]
|
| 254 |
split_labels = labels[index:max(len(input_ids), index + self.CHUNK_SIZE)]
|
|
|
|
|
|
|
| 255 |
|
| 256 |
|
| 257 |
yield key, {
|
|
|
|
| 205 |
#print(filepath)
|
| 206 |
#print(split)
|
| 207 |
paths = glob(filepath + '/' + split + '/*.csv')
|
| 208 |
+
print(paths)
|
| 209 |
key = 0
|
| 210 |
for f in paths:
|
| 211 |
+
print(f)
|
| 212 |
df = pd.read_csv(f)
|
| 213 |
input_ids = []
|
| 214 |
labels = []
|
|
|
|
| 245 |
else:
|
| 246 |
continue
|
| 247 |
|
| 248 |
+
print('got all')
|
| 249 |
for chunk_id, index in enumerate(range(0, len(input_ids), self.CHUNK_SIZE)):
|
| 250 |
split_ids = input_ids[index:max(len(input_ids), index + self.CHUNK_SIZE)]
|
| 251 |
#split_bboxes = bboxes[index:index + self.CHUNK_SIZE]
|
| 252 |
# split_rgbs = rgbs[index:index + self.CHUNK_SIZE]
|
| 253 |
# split_fonts = fonts[index:index + self.CHUNK_SIZE]
|
| 254 |
split_labels = labels[index:max(len(input_ids), index + self.CHUNK_SIZE)]
|
| 255 |
+
print(split_labels, len(split_labels))
|
| 256 |
+
print(split_ids, len(split_ids))
|
| 257 |
|
| 258 |
|
| 259 |
yield key, {
|