MCPcopy Create free account
hub / github.com/CandleLabAI/PCBSegClassNet / parse_data

Method parse_data

src/data/dataloader.py:144–155  ·  view source on GitHub ↗
(self, image, label)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected