Update app.py
Browse files72 unmodified lines7374757677787980818283848553 unmodified lines13914014114214314414514614714872 unmodified linesimage = np.transpose(image, (1, 2, 0))return (image * 255).astype(np.uint8)def deblur_image(file):if file is None:return Nonetry:# Load the image from the uploaded fileinput_image = Image.open(file.name).convert("RGB")# Save original sizeoriginal_size = input_image.size53 unmodified lines}"""# ✅ Gradio interface using gr.File (no preview) with custom CSSdemo = gr.Interface(fn=deblur_image,inputs=gr.File(label="Upload Blurry Image (No Preview)", type="file"),outputs=gr.Image(type="numpy", label="Deblurred Result"),title="Image Deblurring",description="Upload a blurry image and get it deblurred using deep learning.",72 unmodified lines7374757677787980818283848553 unmodified lines13914014114214314414514614714872 unmodified linesimage = np.transpose(image, (1, 2, 0))return (image * 255).astype(np.uint8)def deblur_image(filepath):if filepath is None:return Nonetry:# Load the image from the filepathinput_image = Image.open(filepath).convert("RGB")# Save original sizeoriginal_size = input_image.size53 unmodified lines}"""# ✅ Gradio interface using gr.File with correct typedemo = gr.Interface(fn=deblur_image,inputs=gr.File(label="Upload Blurry Image (No Preview)", type="filepath"),outputs=gr.Image(type="numpy", label="Deblurred Result"),title="Image Deblurring",description="Upload a blurry image and get it deblurred using deep learning.",
app.py+6-6