(self, image, label)
| 142 | self.num_classes = num_classes |
| 143 | |
| 144 | def parse_data(self, image, label): |
| 145 | # read the image from disk, decode it, convert the data type to |
| 146 | # floating point, and resize it |
| 147 | image = tf.io.read_file(image) |
| 148 | image = tf.image.decode_png(image, channels=3) |
| 149 | image = tf.image.convert_image_dtype(image, dtype=tf.float32) |
| 150 | image = tf.image.resize(image, (self.opt["img_size_h"], self.opt["img_size_w"])) |
| 151 | |
| 152 | label = label |
| 153 | |
| 154 | # return the image and the label |
| 155 | return image, label |
| 156 | |
| 157 | def init(self, images, labels): |
| 158 | labels = tf.keras.utils.to_categorical(labels, num_classes=self.num_classes) |
nothing calls this directly
no outgoing calls
no test coverage detected