(image_file, pad=False)
| 147 | return cropped_img |
| 148 | |
| 149 | def load_image(image_file, pad=False): |
| 150 | if image_file.startswith('http') or image_file.startswith('https'): |
| 151 | response = requests.get(image_file) |
| 152 | image = Image.open(BytesIO(response.content)).convert('RGB') |
| 153 | else: |
| 154 | image = Image.open(image_file).convert('RGB') |
| 155 | if pad: |
| 156 | image = expand2square(image) |
| 157 | return image |
| 158 | |
| 159 | def load_txt(path): |
| 160 | strings_list = [] |
nothing calls this directly
no test coverage detected