Spaces:
Runtime error
Runtime error
Update utility/utils.py
Browse files44 unmodified lines4546474848495051525354555556565758596044 unmodified lines# Initialize the InferenceClientclient = InferenceClient(model="mistralai/Mistral-7B-Instruct-v0.3", token=HFT)
# Load image using OpenCVdef load_image(image_path): ext = os.path.splitext(image_path)[1].lower() if ext in ['.png', '.jpg', '.jpeg', '.webp', '.tiff']: image = cv2.imread(image_path) if image is None: raise ValueError(f"Failed to load image from {image_path}. The file may be corrupted or unreadable.") return image else: raise ValueError(f"Could not load image from {image_path}. It may be corrupted or the path is incorrect. or in a not supported format") raise ValueError(f"Unsupported image format: {ext}") # Function for upscaling image using OpenCV's INTER_CUBICdef upscale_image(image, scale=2): height, width = image.shape[:2]utility/utils.py+4-3