chriamue commited on
Commit
c0144ee
1 Parent(s): 3b57330
Files changed (1) hide show
  1. bird-species-dataset.py +2 -2
bird-species-dataset.py CHANGED
@@ -1,4 +1,3 @@
1
- import os
2
  import datasets
3
  from datasets import SplitGenerator, Split, ImageClassification
4
 
@@ -601,7 +600,8 @@ class BirdSpeciesDataset(datasets.GeneratorBasedBuilder):
601
  idx = 0
602
  for path, fo in files:
603
 
604
- label = os.path.basename(os.path.dirname(path))
 
605
 
606
  record = {
607
  "image": {"path": path, "bytes": fo.read()},
 
 
1
  import datasets
2
  from datasets import SplitGenerator, Split, ImageClassification
3
 
 
600
  idx = 0
601
  for path, fo in files:
602
 
603
+ parts = path.split('/')
604
+ label = parts[-2]
605
 
606
  record = {
607
  "image": {"path": path, "bytes": fo.read()},