diff options
Diffstat (limited to 'data')
| -rw-r--r-- | data/csv.py | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/data/csv.py b/data/csv.py index 5de3ac7..2a8115b 100644 --- a/data/csv.py +++ b/data/csv.py | |||
| @@ -15,9 +15,6 @@ from data.keywords import prompt_to_keywords, keywords_to_prompt | |||
| 15 | from models.clip.util import unify_input_ids | 15 | from models.clip.util import unify_input_ids |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | image_cache: dict[str, Image.Image] = {} | ||
| 19 | |||
| 20 | |||
| 21 | interpolations = { | 18 | interpolations = { |
| 22 | "linear": transforms.InterpolationMode.NEAREST, | 19 | "linear": transforms.InterpolationMode.NEAREST, |
| 23 | "bilinear": transforms.InterpolationMode.BILINEAR, | 20 | "bilinear": transforms.InterpolationMode.BILINEAR, |
| @@ -27,14 +24,9 @@ interpolations = { | |||
| 27 | 24 | ||
| 28 | 25 | ||
| 29 | def get_image(path): | 26 | def get_image(path): |
| 30 | if path in image_cache: | ||
| 31 | return image_cache[path] | ||
| 32 | |||
| 33 | image = Image.open(path) | 27 | image = Image.open(path) |
| 34 | if not image.mode == "RGB": | 28 | if not image.mode == "RGB": |
| 35 | image = image.convert("RGB") | 29 | image = image.convert("RGB") |
| 36 | image_cache[path] = image | ||
| 37 | |||
| 38 | return image | 30 | return image |
| 39 | 31 | ||
| 40 | 32 | ||
