Aryan-EcoClim commited on
Commit
dfaea14
·
1 Parent(s): 1614706

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -82,8 +82,12 @@ elif mode == "Train Mode":
82
  image = tf.image.resize(image, (224, 224)) # adjust the size as needed
83
  image = tf.expand_dims(image, axis=0)
84
 
 
 
 
 
85
  # Train the model
86
- model.fit(image, target, epochs=1) # You might want to adjust the number of epochs
87
 
88
  st.success(f'Model has been trained with the new image and label.')
89
  except Exception as e:
 
82
  image = tf.image.resize(image, (224, 224)) # adjust the size as needed
83
  image = tf.expand_dims(image, axis=0)
84
 
85
+ # Create a dataset with the new image and label
86
+ dataset = tf.data.Dataset.from_tensor_slices((image, target))
87
+ dataset = dataset.batch(1) # Batch size 1 as we are using a single image
88
+
89
  # Train the model
90
+ model.fit(dataset, epochs=1) # You might want to adjust the number of epochs
91
 
92
  st.success(f'Model has been trained with the new image and label.')
93
  except Exception as e: