Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
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,
|
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)
|