serhii-korobchenko commited on
Commit
02ac556
·
verified ·
1 Parent(s): 2fc81b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -29,13 +29,13 @@ model.eval()
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))
 
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))