mirror of
https://github.com/qurator-spk/sbb_pixelwise_segmentation.git
synced 2025-06-09 11:50:04 +02:00
Update utils.py
Changed unsafe basename extraction: `file_name = i.split('.')[0]` to `file_name = os.path.splitext(i)[0]` and `filename = n[i].split('.')[0]` to `filename = os.path.splitext(n[i])[0]` because `"Vat.sam.2_206.jpg` -> `Vat` instead of `"Vat.sam.2_206`
This commit is contained in:
parent
be57f137d7
commit
102b04c84d
1 changed files with 2 additions and 2 deletions
4
utils.py
4
utils.py
|
@ -374,7 +374,7 @@ def generate_arrays_from_folder_reading_order(classes_file_dir, modal_dir, batch
|
|||
batchcount = 0
|
||||
while True:
|
||||
for i in all_labels_files:
|
||||
file_name = i.split('.')[0]
|
||||
file_name = os.path.splitext(i)[0]
|
||||
img = cv2.imread(os.path.join(modal_dir,file_name+'.png'))
|
||||
|
||||
label_class = int( np.load(os.path.join(classes_file_dir,i)) )
|
||||
|
@ -401,7 +401,7 @@ def data_gen(img_folder, mask_folder, batch_size, input_height, input_width, n_c
|
|||
|
||||
for i in range(c, c + batch_size): # initially from 0 to 16, c = 0.
|
||||
try:
|
||||
filename = n[i].split('.')[0]
|
||||
filename = os.path.splitext(n[i])[0]
|
||||
|
||||
train_img = cv2.imread(img_folder + '/' + n[i]) / 255.
|
||||
train_img = cv2.resize(train_img, (input_width, input_height),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue