Skip to content

Commit

Permalink
new method for creating taurus training zip
Browse files Browse the repository at this point in the history
  • Loading branch information
NormanTUD committed Feb 19, 2024
1 parent d724e6e commit fc24f5d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -6191,7 +6191,7 @@ function _get_tensorflow_save_model_code () {
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
model.fit(train_generator, validation_data=validation_generator, epochs=${_epochs})
# Speichere das trainierte Modell
# Save the model to model.h5 for future usage.
model.save('model.h5')
`
Expand All @@ -6205,31 +6205,31 @@ function _get_tensorflow_data_loader_code () {
return `
from tensorflow.keras.preprocessing.image import ImageDataGenerator
# Definiere den Pfad zum Ordner mit den Bildern
# Define path to data
data_dir = 'data/'
# Definiere die Größe, zu der die Bilder resized werden sollen
# Define size of images
target_size = (${height}, ${width})
# Erstelle einen ImageDataGenerator, um die Bilder einzulesen und zu resizen
datagen = ImageDataGenerator(rescale=1./divide_by, # Normalisiere die Bildpixel
validation_split=${_validation_split}, # Splitte die Daten automatisch in Trainings- und Validierungssets
preprocessing_function=lambda x: tf.image.resize(x, target_size)) # Resize die Bilder
# Create ImageDataGenerator to read images and resize them
datagen = ImageDataGenerator(rescale=1./divide_by, # Normalize (from 0-255 to 0-1)
validation_split=${_validation_split}, # Split into validation and training datasets
preprocessing_function=lambda x: tf.image.resize(x, target_size)) # Resize images
# Lese die Bilder aus dem Ordner ein und teile sie automatisch in Trainings- und Validierungssets auf
# Read images and split them into training and validation dataset automatically
train_generator = datagen.flow_from_directory(
data_dir,
target_size=target_size,
batch_size=${_batch_size},
class_mode='categorical',
subset='training') # 'training' für das Trainingsset
subset='training')
validation_generator = datagen.flow_from_directory(
data_dir,
target_size=target_size,
batch_size=32,
class_mode='categorical',
subset='validation') # 'validation' für das Validierungsset
subset='validation')
`;
}
Expand Down

0 comments on commit fc24f5d

Please sign in to comment.