miojizzy commited on
Commit
bd29352
·
1 Parent(s): 1e9f171

Update mhr_recognize_datasets.py

Browse files
Files changed (1) hide show
  1. mhr_recognize_datasets.py +6 -1
mhr_recognize_datasets.py CHANGED
@@ -64,7 +64,8 @@ class MHRRecognizeDatasets(datasets.GeneratorBasedBuilder):
64
 
65
  def _generate_examples(self, image_path, label_path):
66
  print(image_path, label_path)
67
- if self.config.name == "whole":
 
68
  # Read csv with image labels
69
  label_csv = read_csv(label_path)
70
  for i, path in enumerate(file_path):
@@ -72,6 +73,10 @@ class MHRRecognizeDatasets(datasets.GeneratorBasedBuilder):
72
  # Get image id to filter the respective row of the csv
73
  image_id = file_name
74
  image_labels = label_csv[label_csv["name"] == image_id]["label"]
 
 
 
 
75
  yield i, {
76
  "image": path,
77
  "labels": image_labels,
 
64
 
65
  def _generate_examples(self, image_path, label_path):
66
  print(image_path, label_path)
67
+ if True:
68
+ # if self.config.name == "whole":
69
  # Read csv with image labels
70
  label_csv = read_csv(label_path)
71
  for i, path in enumerate(file_path):
 
73
  # Get image id to filter the respective row of the csv
74
  image_id = file_name
75
  image_labels = label_csv[label_csv["name"] == image_id]["label"]
76
+ print(i, {
77
+ "image": path,
78
+ "labels": image_labels,
79
+ })
80
  yield i, {
81
  "image": path,
82
  "labels": image_labels,