Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,11 +37,12 @@ def FRFsegment(input_img):
|
|
| 37 |
# Model prediction
|
| 38 |
est_label_dict = model(img)
|
| 39 |
|
| 40 |
-
#
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
| 45 |
|
| 46 |
# Check the shape of the predicted output
|
| 47 |
if len(est_label.shape) == 4 and est_label.shape[-1] > 1:
|
|
@@ -86,4 +87,3 @@ FRFSegapp = gr.Interface(
|
|
| 86 |
|
| 87 |
FRFSegapp.launch()
|
| 88 |
|
| 89 |
-
|
|
|
|
| 37 |
# Model prediction
|
| 38 |
est_label_dict = model(img)
|
| 39 |
|
| 40 |
+
# Print available keys to understand what we are dealing with
|
| 41 |
+
print("Available keys in the output dictionary:", est_label_dict.keys())
|
| 42 |
+
|
| 43 |
+
# Extract the actual tensor from the dictionary using a dynamic key lookup
|
| 44 |
+
key = list(est_label_dict.keys())[0] # Use the first available key
|
| 45 |
+
est_label = est_label_dict[key]
|
| 46 |
|
| 47 |
# Check the shape of the predicted output
|
| 48 |
if len(est_label.shape) == 4 and est_label.shape[-1] > 1:
|
|
|
|
| 87 |
|
| 88 |
FRFSegapp.launch()
|
| 89 |
|
|
|