alibayram commited on
Commit
855db0d
·
1 Parent(s): 69bd373

Refactor predict function: enhance debug output by including image shape and simplifying non-zero value checks

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -40,12 +40,11 @@ def predict(data):
40
  img = np.array(data['composite'])
41
 
42
  # print non-zero values
43
- print("non-zero values", np.count_nonzero(img))
44
  for i in range(img.shape[0]):
45
  for j in range(img.shape[1]):
46
- for k in range(img.shape[2]):
47
- if img[i][j][k] != 0:
48
- print("img[i][j][k]", img[i][j][k])
49
 
50
  print("img.shape", img.shape)
51
 
 
40
  img = np.array(data['composite'])
41
 
42
  # print non-zero values
43
+ print("non-zero values", np.count_nonzero(img), img.shape)
44
  for i in range(img.shape[0]):
45
  for j in range(img.shape[1]):
46
+ if img[i][j] > 0:
47
+ print(i, j, img[i][j])
 
48
 
49
  print("img.shape", img.shape)
50