Spaces:
Runtime error
Runtime error
Update utility/utils.py
Browse files44 unmodified lines45464748495051525354555657585944 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)return imageelse: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")# Function for upscaling image using OpenCV's INTER_CUBICdef upscale_image(image, scale=2):height, width = image.shape[:2]44 unmodified lines4546474849505152535455565758596044 unmodified lines# Initialize the InferenceClientclient = InferenceClient(model="mistralai/Mistral-7B-Instruct-v0.3", token=HFT)def 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 imageelse: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