Ivan000 commited on
Commit
059b0b9
·
verified ·
1 Parent(s): ace09f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,14 +13,14 @@ def scan_qr_code(image):
13
  Scan QR code from the uploaded image.
14
 
15
  Args:
16
- image (PIL.Image.Image or str): The uploaded image or file path.
17
 
18
  Returns:
19
  str: The decoded QR code data with a descriptive message.
20
  """
21
  # Convert file path to PIL image if necessary
22
- if isinstance(image, str):
23
- image = Image.open(image)
24
 
25
  # Convert PIL image to OpenCV format
26
  open_cv_image = np.array(image)
 
13
  Scan QR code from the uploaded image.
14
 
15
  Args:
16
+ image (PIL.Image.Image or dict): The uploaded image or a dictionary containing the image file path.
17
 
18
  Returns:
19
  str: The decoded QR code data with a descriptive message.
20
  """
21
  # Convert file path to PIL image if necessary
22
+ if isinstance(image, dict):
23
+ image = Image.open(image['name'])
24
 
25
  # Convert PIL image to OpenCV format
26
  open_cv_image = np.array(image)