Skip to content

Commit

Permalink
Try resizing first
Browse files Browse the repository at this point in the history
  • Loading branch information
bbpennel committed Apr 19, 2024
1 parent c4dc7c4 commit afb1146
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/image_normalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ def process(self, path):

print(f"Memoryn1: {psutil.virtual_memory()}")
with Image.open(path) as img:
print(f"Memoryn2: {psutil.virtual_memory()}")
print(f"Memoryr2: {psutil.virtual_memory()}")
img = self.resize(img)
print(f"Memoryn3: {psutil.virtual_memory()}")
if img.mode != "RGB":
img = img.convert("RGB")
print(f"Memoryn3: {psutil.virtual_memory()}")
img = self.resize(img)
print(f"Memoryn4: {psutil.virtual_memory()}")
# construct path to write to, then save the file
output_path.parent.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit afb1146

Please sign in to comment.