Spaces:
Runtime error
Runtime error
Update app.py
Browse files4 unmodified lines56789101112 unmodified lines242526272829304 unmodified linesfrom openai import OpenAI# Image Preprocessing Functiondef preprocess_image(image_path):# Convert the file to an OpenCV imagefile_bytes = np.asarray(bytearray(image_file.read()), dtype=np.uint8)image = cv2.imdecode(file_bytes, cv2.IMREAD_COLOR)12 unmodified linesequalized_image = clahe.apply(blurred_image)# Return the preprocessed imagereturn image_path# Function to encode the image to base64def encode_image(image_file):4 unmodified lines56789101112 unmodified lines242526272829304 unmodified linesfrom openai import OpenAI# Image Preprocessing Functiondef preprocess_image(image_file):# Convert the file to an OpenCV imagefile_bytes = np.asarray(bytearray(image_file.read()), dtype=np.uint8)image = cv2.imdecode(file_bytes, cv2.IMREAD_COLOR)12 unmodified linesequalized_image = clahe.apply(blurred_image)# Return the preprocessed imagereturn image_file# Function to encode the image to base64def encode_image(image_file):
app.py+2-2