TroglodyteDerivations commited on
Commit
dafd110
1 Parent(s): 6536eba

Updated line 68 with: image_index = 89 | Updated lines 47,49,51,53,55,57 with: st.write() | Updated line 25 with: st.write('The model summary =', model) | Updated line 22 with model.summary() |

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -19,8 +19,10 @@ st.write('The shape of X_test = ', X_test.shape)
19
  # Populate the y_test shape
20
  st.write('The shape of y_test = ', y_test.shape)
21
 
 
 
22
  # Populate the model summary
23
- st.write('The model summary =', model.summary())
24
 
25
  # The output of y_test equals (55505, 2) 2-Dimensional Array [Reduce the Dimensionality into 1D]
26
  # Ensure y_test is a 1D array (Although, the inference drawn from y_test data is that it is a 2D array)
@@ -42,11 +44,17 @@ def predict_diagnosis(image_data, image_index):
42
  # Preprocess the image data (e.g., reshape, normalize)
43
  if len(image_data.shape) == 3:
44
  st.write('Implementation fails with: # image_data = image_data.reshape(1, image_data.shape[0], image_data.shape[1], image_data.shape[2])')
 
45
  st.write('Reshaping 3-Dimensional array into 4-Dimensional array not possible')
 
46
  st.write('Reshape an array of size 56250000 into a shape of (1,1,50,50)')
 
47
  st.write('Not possible because the total number of elements in the array (56250000)')
 
48
  st.write("Does not match the product of the new shapes dimensions (1150*50 = 5000)")
 
49
  st.write('Adding a new dimension obverse np.expand_dims not reshape')
 
50
  image_data = np.expand_dims(image_data, axis=0)
51
 
52
  image_data = image_data.astype('float32') / 255
@@ -64,8 +72,8 @@ def predict_diagnosis(image_data, image_index):
64
 
65
  return predicted_label, true_label
66
 
67
- # Select an image index from the X_test dataset: 88
68
- image_index = 88
69
  image_data = X_test[image_index]
70
 
71
  # Predict the diagnosis
 
19
  # Populate the y_test shape
20
  st.write('The shape of y_test = ', y_test.shape)
21
 
22
+ model.summary()
23
+
24
  # Populate the model summary
25
+ st.write('The model summary =', model)
26
 
27
  # The output of y_test equals (55505, 2) 2-Dimensional Array [Reduce the Dimensionality into 1D]
28
  # Ensure y_test is a 1D array (Although, the inference drawn from y_test data is that it is a 2D array)
 
44
  # Preprocess the image data (e.g., reshape, normalize)
45
  if len(image_data.shape) == 3:
46
  st.write('Implementation fails with: # image_data = image_data.reshape(1, image_data.shape[0], image_data.shape[1], image_data.shape[2])')
47
+ st.write()
48
  st.write('Reshaping 3-Dimensional array into 4-Dimensional array not possible')
49
+ st.write()
50
  st.write('Reshape an array of size 56250000 into a shape of (1,1,50,50)')
51
+ st.write()
52
  st.write('Not possible because the total number of elements in the array (56250000)')
53
+ st.write()
54
  st.write("Does not match the product of the new shapes dimensions (1150*50 = 5000)")
55
+ st.write()
56
  st.write('Adding a new dimension obverse np.expand_dims not reshape')
57
+ st.write()
58
  image_data = np.expand_dims(image_data, axis=0)
59
 
60
  image_data = image_data.astype('float32') / 255
 
72
 
73
  return predicted_label, true_label
74
 
75
+ # Select an image index from the X_test dataset: 89
76
+ image_index = 89
77
  image_data = X_test[image_index]
78
 
79
  # Predict the diagnosis