diff --git a/fast-DreamBooth.ipynb b/fast-DreamBooth.ipynb index 8c5c4453..61ec368c 100644 --- a/fast-DreamBooth.ipynb +++ b/fast-DreamBooth.ipynb @@ -566,9 +566,15 @@ " if file.size !=(Crop_size, Crop_size):\n", " image=crop_image(file, Crop_size)\n", " if extension.upper() == \"JPG\" or \"jpg\":\n", + " try:", " image[0].save(new_path_with_file, format=\"JPEG\", quality = 100)\n", + " except:", + " print(image[0], 'failed to save')", " else:\n", + " try:", " image[0].save(new_path_with_file, format=extension.upper())\n", + " except:", + " print(image[0], 'failed to save')", " else:\n", " !cp \"$IMAGES_FOLDER_OPTIONAL/$filename\" \"$INSTANCE_DIR\"\n", "\n", @@ -597,9 +603,15 @@ " if file.size !=(Crop_size, Crop_size):\n", " image=crop_image(file, Crop_size)\n", " if extension.upper() == \"JPG\" or \"jpg\":\n", + " try:", " image[0].save(new_path_with_file, format=\"JPEG\", quality = 100)\n", + " except:", + " print(image[0], 'failed to save')", " else:\n", + " try:", " image[0].save(new_path_with_file, format=extension.upper())\n", + " except:", + " print(image[0], 'failed to save')", " clear_output()\n", " else:\n", " for filename in tqdm(uploaded.keys(), bar_format=' |{bar:15}| {n_fmt}/{total_fmt} Uploaded'):\n",