Skip to content
Snippets Groups Projects
Commit 8dc0b495 authored by maali's avatar maali
Browse files

Add getAllValDataFruits function

parent b0129f48
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,26 @@ def getAllValData(modelClass='cat'): # retrieves random image and label set fro
return image_ls, labels_ls, mask_ls
def getAllValDataFruits(modelClass='cat'): # retrieves random image and label set from specified dataset
trainData, validData = getDataSplit_Fruits(modelClass=modelClass)
basePath = os.path.dirname(
os.path.realpath(__file__)) + '/Generated_Worlds_/Generated_Worlds_Evaluating/' + modelClass
image_ls = []
labels_ls = []
mask_ls = []
choice_ls = []
for choice in validData:
with open(basePath + '/FPS_resized/' + choice[2]) as f:
labels = f.readline().split(' ')[1:19]
labels_ls.append(labels)
image = filePathToArray(basePath + '/RGB_resized/' + choice[0])
mask = filePathToArray(basePath + '/Instance_Mask_resized/' + choice[1])
image_ls.append(image)
mask_ls.append(mask)
choice_ls.append(choice[0])
return image_ls, labels_ls, mask_ls, choice_ls
def getMasterList(basePath): # returns list with image, mask, and label filenames
imageList = sorted(os.listdir(basePath + '/rgb/'))
maskList = sorted(os.listdir(basePath + '/mask/'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment