Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -29,13 +29,13 @@ model.eval()
|
|
29 |
def predict(im):
|
30 |
|
31 |
def list_shape(lst):
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
|
40 |
|
41 |
print(list_shape(im))
|
|
|
29 |
def predict(im):
|
30 |
|
31 |
def list_shape(lst):
|
32 |
+
if not isinstance(lst, list):
|
33 |
+
return []
|
34 |
+
if not lst:
|
35 |
+
return [0]
|
36 |
+
shapes = [list_shape(sublist) for sublist in lst]
|
37 |
+
max_shape = max(shapes, key=len)
|
38 |
+
return [len(lst)] + [max(dimensions[i] if i < len(dimensions) else 0 for dimensions in shapes) for i in range(len(max_shape))]
|
39 |
|
40 |
|
41 |
print(list_shape(im))
|