Refactor predict function: enhance debug output by including image shape and simplifying non-zero value checks
Browse files
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 |
-
|
47 |
-
|
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 |
|