Extract images. :param img_path: A string representing the path to the images.
(img_path)
| 69 | |
| 70 | |
| 71 | def get_images(img_path): |
| 72 | """ |
| 73 | Extract images. |
| 74 | |
| 75 | :param img_path: A string representing the path to the images. |
| 76 | """ |
| 77 | # Get image URIs |
| 78 | pil_images = [ |
| 79 | Image.open(os.path.join(img_path, image_name)) |
| 80 | for image_name in os.listdir(img_path) |
| 81 | if image_name.endswith(".jpg") |
| 82 | ] |
| 83 | return pil_images |
| 84 | |
| 85 | |
| 86 | def resize_base64_image(base64_string, size=(128, 128)): |