rshrott commited on
Commit
a2eea17
1 Parent(s): af32696

Update renovation.py

Browse files
Files changed (1) hide show
  1. renovation.py +11 -1
renovation.py CHANGED
@@ -88,10 +88,20 @@ class Renovations(datasets.GeneratorBasedBuilder):
88
  print(f"Processing {len(files)} files:")
89
  for i, path in enumerate(files):
90
  print(f"Processing file {i}: {path}")
91
- label = os.path.basename(os.path.dirname(os.path.dirname(os.path.dirname(path)))).lower()
 
 
 
 
 
 
 
 
 
92
  print(f"Label: {label}")
93
  yield i, {
94
  "image_file_path": path,
95
  "image": path,
96
  "labels": label,
97
  }
 
 
88
  print(f"Processing {len(files)} files:")
89
  for i, path in enumerate(files):
90
  print(f"Processing file {i}: {path}")
91
+ dirname = os.path.dirname(path)
92
+ print(f"Dirname: {dirname}")
93
+ parent_dirname = os.path.dirname(dirname)
94
+ print(f"Parent Dirname: {parent_dirname}")
95
+ grandparent_dirname = os.path.dirname(parent_dirname)
96
+ print(f"Grandparent Dirname: {grandparent_dirname}")
97
+ great_grandparent_dirname = os.path.dirname(grandparent_dirname)
98
+ print(f"Great Grandparent Dirname: {great_grandparent_dirname}")
99
+
100
+ label = os.path.basename(great_grandparent_dirname).lower()
101
  print(f"Label: {label}")
102
  yield i, {
103
  "image_file_path": path,
104
  "image": path,
105
  "labels": label,
106
  }
107
+