Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from PIL import Image, ImageEnhance | |
| import numpy as np | |
| import os | |
| def enhance_image(image, language): | |
| img = image.convert("RGB") | |
| img = ImageEnhance.Sharpness(img).enhance(2.0) | |
| img = ImageEnhance.Contrast(img).enhance(1.5) | |
| img = ImageEnhance.Color(img).enhance(1.2) # Optional: color boost | |
| img.save("enhanced.png") | |
| return img, "enhanced.png" | |
| with gr.Blocks() as demo: | |
| gr.Markdown("## 📷 Bonolota_AI HD Enhancer") | |
| with gr.Row(): | |
| with gr.Column(): | |
| image_input = gr.Image(type="pil", label="📤 ফটো আপলোড করুন") | |
| lang_choice = gr.Radio(["Bengali", "English"], label="🌐 ভাষা", value="Bengali") | |
| submit_btn = gr.Button("✅ Enhance করুন") | |
| with gr.Column(): | |
| image_output = gr.Image(type="pil", label="🖼️ Enhanced Image") | |
| download_link = gr.File(label="⬇️ Download", visible=False) | |
| def process(image, language): | |
| result, path = enhance_image(image, language) | |
| return result, path | |
| submit_btn.click(fn=process, inputs=[image_input, lang_choice], outputs=[image_output, download_link]) | |
| demo.launch() |