October 2018
Intermediate to advanced
472 pages
10h 57m
English
Now let's transform the images and their corresponding joints to the desired form by using the functions we have defined previously. We will do this with the help of the model_data() function, which is defined as follows:
def model_data(image_ids, joints, train = True): """Function to generate train and test data.""" if train: # empty list train_img_joints = [] # create train directory inside FLIC-full if not os.path.exists(os.path.join(os.getcwd(), 'FLIC-full/train')): os.mkdir('FLIC-full/train') for i, (image, joint) in enumerate(zip(image_ids, joints)): # crop the image using the joint coordinates image, joint = image_cropping(image, joint) # resize the cropped image to shape (224*224*3) image, joint = image_resize(image, ...Read now
Unlock full access