Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import numpy as np
|
|
| 5 |
from openai import OpenAI
|
| 6 |
|
| 7 |
# Image Preprocessing Function
|
| 8 |
-
def preprocess_image(
|
| 9 |
# Convert the file to an OpenCV image
|
| 10 |
file_bytes = np.asarray(bytearray(image_file.read()), dtype=np.uint8)
|
| 11 |
image = cv2.imdecode(file_bytes, cv2.IMREAD_COLOR)
|
|
@@ -24,7 +24,7 @@ def preprocess_image(image_path):
|
|
| 24 |
equalized_image = clahe.apply(blurred_image)
|
| 25 |
|
| 26 |
# Return the preprocessed image
|
| 27 |
-
return
|
| 28 |
|
| 29 |
# Function to encode the image to base64
|
| 30 |
def encode_image(image_file):
|
|
|
|
| 5 |
from openai import OpenAI
|
| 6 |
|
| 7 |
# Image Preprocessing Function
|
| 8 |
+
def preprocess_image(image_file):
|
| 9 |
# Convert the file to an OpenCV image
|
| 10 |
file_bytes = np.asarray(bytearray(image_file.read()), dtype=np.uint8)
|
| 11 |
image = cv2.imdecode(file_bytes, cv2.IMREAD_COLOR)
|
|
|
|
| 24 |
equalized_image = clahe.apply(blurred_image)
|
| 25 |
|
| 26 |
# Return the preprocessed image
|
| 27 |
+
return image_file
|
| 28 |
|
| 29 |
# Function to encode the image to base64
|
| 30 |
def encode_image(image_file):
|