Add preprocess_image and create_fs function