img = None
if self.mode == DataSetMode.PREDICT or self.mode == DataSetMode.TRAIN or self.mode == DataSetMode.PRED_AND_EVAL:
img = np.array(Image.open(image_path))
for sample in loader.load(image_path, xml_path):
text = sample["text"]
orientation = sample["orientation"]
After Change
img = None
if self.mode == DataSetMode.PREDICT or self.mode == DataSetMode.TRAIN or self.mode == DataSetMode.PRED_AND_EVAL:
img = load_image(image_path)
for sample in loader.load(image_path, xml_path):
text = sample["text"]
orientation = sample["orientation"]