Spaces:
Running
on
Zero
Running
on
Zero
manually install gradio
Browse files- app.py +3 -1
- utils/old_gradio_class.py +0 -19
app.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
import io
|
| 2 |
import os
|
|
|
|
|
|
|
| 3 |
|
| 4 |
import json
|
| 5 |
import base64
|
|
@@ -207,7 +209,7 @@ blank_image = np.array(Image.open('data/images/final.png').convert('RGB'))
|
|
| 207 |
PART_IMAGES_DICT = {file_name: load_part_images(file_name) for file_name in IMAGE_FILE_LIST}
|
| 208 |
|
| 209 |
# --- Gradio Functions ---
|
| 210 |
-
def update_selected_image(event:
|
| 211 |
image_height = 400
|
| 212 |
index = event.index
|
| 213 |
|
|
|
|
| 1 |
import io
|
| 2 |
import os
|
| 3 |
+
os.system("pip uninstall -y gradio")
|
| 4 |
+
os.system("pip install gradio==3.41.0")
|
| 5 |
|
| 6 |
import json
|
| 7 |
import base64
|
|
|
|
| 209 |
PART_IMAGES_DICT = {file_name: load_part_images(file_name) for file_name in IMAGE_FILE_LIST}
|
| 210 |
|
| 211 |
# --- Gradio Functions ---
|
| 212 |
+
def update_selected_image(event: gr.electData):
|
| 213 |
image_height = 400
|
| 214 |
index = event.index
|
| 215 |
|
utils/old_gradio_class.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
from gradio.helpers import EventData
|
| 2 |
-
from gradio.blocks import Block
|
| 3 |
-
from typing import Any
|
| 4 |
-
|
| 5 |
-
class SelectData(EventData):
|
| 6 |
-
def __init__(self, target: Block | None, data: Any):
|
| 7 |
-
super().__init__(target, data)
|
| 8 |
-
self.index: int | tuple[int, int] = data["index"]
|
| 9 |
-
"""
|
| 10 |
-
The index of the selected item. Is a tuple if the component is two dimensional or selection is a range.
|
| 11 |
-
"""
|
| 12 |
-
self.value: Any = data["value"]
|
| 13 |
-
"""
|
| 14 |
-
The value of the selected item.
|
| 15 |
-
"""
|
| 16 |
-
self.selected: bool = data.get("selected", True)
|
| 17 |
-
"""
|
| 18 |
-
True if the item was selected, False if deselected.
|
| 19 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|