Spaces:
Sleeping
Sleeping
Fix ImageSlider: use gradio_imageslider custom component
Browse files- ImageSlider is NOT built into Gradio, it's a separate package
- Added gradio_imageslider==0.0.18 to requirements
- Changed gr.ImageSlider to ImageSlider from gradio_imageslider
- Pinned gradio==4.44.0 (compatible with the component)
- Added huggingface_hub<0.24 to fix HfFolder import
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- README.md +1 -1
- app.py +2 -1
- pyproject.toml +3 -1
- requirements.txt +3 -1
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🔬
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
python_version: "3.11"
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
|
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
python_version: "3.11"
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
app.py
CHANGED
|
@@ -16,6 +16,7 @@ from pathlib import Path
|
|
| 16 |
from typing import Tuple, Optional
|
| 17 |
|
| 18 |
import gradio as gr
|
|
|
|
| 19 |
import matplotlib.pyplot as plt
|
| 20 |
import numpy as np
|
| 21 |
import torch
|
|
@@ -522,7 +523,7 @@ def create_app() -> gr.Blocks:
|
|
| 522 |
# Right column: outputs
|
| 523 |
with gr.Column(scale=2):
|
| 524 |
# Image comparison slider
|
| 525 |
-
image_slider =
|
| 526 |
label="Original (left) vs Upsampled (right)",
|
| 527 |
type="numpy",
|
| 528 |
)
|
|
|
|
| 16 |
from typing import Tuple, Optional
|
| 17 |
|
| 18 |
import gradio as gr
|
| 19 |
+
from gradio_imageslider import ImageSlider
|
| 20 |
import matplotlib.pyplot as plt
|
| 21 |
import numpy as np
|
| 22 |
import torch
|
|
|
|
| 523 |
# Right column: outputs
|
| 524 |
with gr.Column(scale=2):
|
| 525 |
# Image comparison slider
|
| 526 |
+
image_slider = ImageSlider(
|
| 527 |
label="Original (left) vs Upsampled (right)",
|
| 528 |
type="numpy",
|
| 529 |
)
|
pyproject.toml
CHANGED
|
@@ -8,7 +8,9 @@ license = "Apache-2.0"
|
|
| 8 |
dependencies = [
|
| 9 |
"torch>=2.0",
|
| 10 |
"numpy>=1.21",
|
| 11 |
-
"gradio
|
|
|
|
|
|
|
| 12 |
"pillow>=9.0",
|
| 13 |
"scipy>=1.9",
|
| 14 |
"timm>=0.9",
|
|
|
|
| 8 |
dependencies = [
|
| 9 |
"torch>=2.0",
|
| 10 |
"numpy>=1.21",
|
| 11 |
+
"gradio==4.44.0",
|
| 12 |
+
"gradio_imageslider==0.0.18",
|
| 13 |
+
"huggingface_hub<0.24",
|
| 14 |
"pillow>=9.0",
|
| 15 |
"scipy>=1.9",
|
| 16 |
"timm>=0.9",
|
requirements.txt
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
torch>=2.0
|
| 2 |
numpy>=1.21
|
| 3 |
-
gradio
|
|
|
|
|
|
|
| 4 |
pillow>=9.0
|
| 5 |
scipy>=1.9
|
| 6 |
timm>=0.9
|
|
|
|
| 1 |
torch>=2.0
|
| 2 |
numpy>=1.21
|
| 3 |
+
gradio==4.44.0
|
| 4 |
+
gradio_imageslider==0.0.18
|
| 5 |
+
huggingface_hub<0.24
|
| 6 |
pillow>=9.0
|
| 7 |
scipy>=1.9
|
| 8 |
timm>=0.9
|