m7mdal7aj commited on
Commit
2cd3e03
1 Parent(s): b5bf11c

Update my_model/state_manager.py

Browse files
Files changed (1) hide show
  1. my_model/state_manager.py +8 -8
my_model/state_manager.py CHANGED
@@ -271,14 +271,14 @@ class StateManager:
271
  """
272
 
273
  img = copy.deepcopy(image_input)
274
- if isinstance(img, str):
275
- # Open the image from a file path
276
- image = Image.open(img)
277
- elif isinstance(img, Image.Image):
278
- # Use the image directly if it's already a PIL Image object
279
- image = img
280
- else:
281
- raise ValueError("image_input must be a file path or a PIL Image object")
282
 
283
  if new_width is not None and new_height is None:
284
  # Calculate new height to maintain aspect ratio
 
271
  """
272
 
273
  img = copy.deepcopy(image_input)
274
+ if isinstance(img, str):
275
+ # Open the image from a file path
276
+ image = Image.open(img)
277
+ elif isinstance(img, Image.Image):
278
+ # Use the image directly if it's already a PIL Image object
279
+ image = img
280
+ else:
281
+ raise ValueError("image_input must be a file path or a PIL Image object")
282
 
283
  if new_width is not None and new_height is None:
284
  # Calculate new height to maintain aspect ratio