Let's preprocess the raccoon dataset and build an object localization model:
- Our dataset contains images of different sizes. Let's fix the image's width and height and initialize a few other parameters:
image_channels = 3batch_size = 15image_width_resized = 96image_height_resized = 96model_name = "raccoon_1_"
- Now, we rescale the coordinates of the bounding box according to the new image dimensions:
labels$x_min_resized = (labels[,'xmin']/(labels[,'width']) * image_width_resized)%>% round()labels$y_min_resized = (labels[,'ymin']/(labels[,'height']) * image_height_resized)%>% round()labels$x_max_resized = (labels[,'xmax']/(labels[,'width']) * image_width_resized)%>% round()labels$y_max_resized = (labels[,'ymax']/(labels[,'height']) ...