From 98a2ccc4266ed01b438e9ee7ab0b309825fc864f Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Mon, 26 Aug 2024 11:07:40 -0400 Subject: [PATCH] Replace deprecated API. Address https://stackoverflow.com/questions/15345790/scipy-misc-module-has-no-attribute-imread. --- 5-Image_Segmentation/FCN/parser_voc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/5-Image_Segmentation/FCN/parser_voc.py b/5-Image_Segmentation/FCN/parser_voc.py index 33787c88..64feee4a 100644 --- a/5-Image_Segmentation/FCN/parser_voc.py +++ b/5-Image_Segmentation/FCN/parser_voc.py @@ -15,7 +15,7 @@ import argparse import numpy as np from utils import colormap -from scipy import misc +import imageio if not os.path.exists("./data"): os.mkdir("./data") if not os.path.exists("./data/train_labels"): os.mkdir("./data/train_labels") @@ -42,7 +42,7 @@ if not os.path.exists(image_path): continue image_write.writelines(image_path+"\n") label_path = os.path.join(train_label_folder, train_label_image) - label_image = np.array(misc.imread(label_path)) + label_image = np.array(imageio.imread(label_path)) write_label = open(("./data/%s_labels/" % mode)+label_name+".txt", 'w') print("=> processing %s" %label_path) H, W, C = label_image.shape