GeorgeIbrahim commited on
Commit
1749fc6
·
1 Parent(s): 81c4d52
Files changed (1) hide show
  1. app.py +16 -17
app.py CHANGED
@@ -27,23 +27,22 @@ try:
27
  print("Dataset features:", dataset.features) # Check if 'split' is part of features
28
 
29
 
30
- # Check if the 'split' column exists; if not, add it
31
- if 'split' not in dataset.column_names:
32
- split_values = []
33
- for example in dataset:
34
- match = re.search(r'_(\d+)\.', example["image_id"])
35
- image_id = match.group(1).lstrip('0')
36
-
37
- if image_id in results:
38
- split_values.append("dev")
39
- else:
40
- split_values.append("train")
41
-
42
- # Add 'split' column to the dataset
43
- dataset = dataset.replace_column("split", split_values)
44
- print("Added 'split' column to dataset.")
45
- else:
46
- print("'split' column already exists.")
47
 
48
  # Create a dictionary to keep track of the highest annotation count for each image
49
  annotation_counts = {}
 
27
  print("Dataset features:", dataset.features) # Check if 'split' is part of features
28
 
29
 
30
+ # # Check if the 'split' column exists; if not, add it
31
+ # if 'split' not in dataset.column_names:
32
+ split_values = []
33
+ for example in dataset:
34
+ match = re.search(r'_(\d+)\.', example["image_id"])
35
+ image_id = match.group(1).lstrip('0')
36
+ if image_id in results:
37
+ split_values.append("dev")
38
+ else:
39
+ split_values.append("train")
40
+
41
+ dataset = dataset.replace_column("split", split_values)
42
+ # print("Added 'split' column to dataset.")
43
+
44
+ # else:
45
+ # print("'split' column already exists.")
 
46
 
47
  # Create a dictionary to keep track of the highest annotation count for each image
48
  annotation_counts = {}