Upload CommyTesting.py
Browse files- CommyTesting.py +3 -2
CommyTesting.py
CHANGED
|
@@ -24,6 +24,7 @@ train = pd.read_csv('Train.csv')
|
|
| 24 |
lis1 = train['id_code']
|
| 25 |
lis2 = train['diagnosis']
|
| 26 |
dic = dict(zip(lis1, lis2))
|
|
|
|
| 27 |
|
| 28 |
# TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
|
| 29 |
class ImagesDemo(datasets.GeneratorBasedBuilder):
|
|
@@ -73,9 +74,9 @@ class ImagesDemo(datasets.GeneratorBasedBuilder):
|
|
| 73 |
idx = 0
|
| 74 |
for filepath, image in images:
|
| 75 |
print(filepath)
|
| 76 |
-
check = filepath.split('/')[-1].replace('.jpg', '')
|
| 77 |
yield idx, {
|
| 78 |
"image" : {"path": filepath, "bytes": image.read()},
|
| 79 |
-
"label" :
|
| 80 |
}
|
| 81 |
idx+=1
|
|
|
|
| 24 |
lis1 = train['id_code']
|
| 25 |
lis2 = train['diagnosis']
|
| 26 |
dic = dict(zip(lis1, lis2))
|
| 27 |
+
classes = [0] * 4209
|
| 28 |
|
| 29 |
# TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
|
| 30 |
class ImagesDemo(datasets.GeneratorBasedBuilder):
|
|
|
|
| 74 |
idx = 0
|
| 75 |
for filepath, image in images:
|
| 76 |
print(filepath)
|
| 77 |
+
# check = filepath.split('/')[-1].replace('.jpg', '')
|
| 78 |
yield idx, {
|
| 79 |
"image" : {"path": filepath, "bytes": image.read()},
|
| 80 |
+
"label" : classes[idx]
|
| 81 |
}
|
| 82 |
idx+=1
|