Commit 
							
							·
						
						5b87c67
	
1
								Parent(s):
							
							738866b
								
Add id to yield _generate_examples
Browse files- CXR_Reports.py +2 -9
    	
        CXR_Reports.py
    CHANGED
    
    | @@ -45,14 +45,7 @@ class ReportsCXR(datasets.GeneratorBasedBuilder): | |
| 45 | 
             
              def _generate_examples(self, filepath):
         | 
| 46 | 
             
                raw_image_dataset = tf.data.TFRecordDataset(filepath)
         | 
| 47 | 
             
                parsed_image_dataset = raw_image_dataset.map(_parse_image_function)
         | 
| 48 | 
            -
                 | 
| 49 | 
            -
                for image_features in parsed_image_dataset:
         | 
| 50 | 
            -
                  print(f"image_features type {type(image_features)}")
         | 
| 51 | 
            -
                  print(f"image type {type(image_features['image'])}")
         | 
| 52 | 
            -
                  print(f"report type {type(image_features['report'])}")
         | 
| 53 | 
             
                  image_raw = image_features['image'].numpy()
         | 
| 54 | 
            -
                  print(f"image_raw type {type(image_raw)}")
         | 
| 55 | 
            -
                  #str_report = np.array2string(image_features['report'].numpy())
         | 
| 56 | 
             
                  str_report = str(image_features['report'])
         | 
| 57 | 
            -
                   | 
| 58 | 
            -
                  yield {'image': {"path":"", "bytes": image_raw}, 'report': str_report}
         | 
|  | |
| 45 | 
             
              def _generate_examples(self, filepath):
         | 
| 46 | 
             
                raw_image_dataset = tf.data.TFRecordDataset(filepath)
         | 
| 47 | 
             
                parsed_image_dataset = raw_image_dataset.map(_parse_image_function)
         | 
| 48 | 
            +
                for i, image_features in enumerate(parsed_image_dataset):
         | 
|  | |
|  | |
|  | |
|  | |
| 49 | 
             
                  image_raw = image_features['image'].numpy()
         | 
|  | |
|  | |
| 50 | 
             
                  str_report = str(image_features['report'])
         | 
| 51 | 
            +
                  yield i, {'image': image_raw, 'report': str_report}
         | 
|  |