diff --git a/ui/agender_ui/login_signup/views.py b/ui/agender_ui/login_signup/views.py index ed03bbb..a1e73a3 100644 --- a/ui/agender_ui/login_signup/views.py +++ b/ui/agender_ui/login_signup/views.py @@ -30,32 +30,32 @@ # Create your views here. -# def age_model(): -# model = tf.keras.Sequential() -# model.add(tf.keras.layers.Conv2D( -# 64, 3, activation='relu', input_shape=(200, 200, 3))) -# model.add(tf.keras.layers.MaxPool2D()) -# model.add(tf.keras.layers.Conv2D(128, 3, activation='relu')) -# model.add(tf.keras.layers.MaxPool2D()) -# model.add(tf.keras.layers.Conv2D(256, 3, activation='relu')) -# model.add(tf.keras.layers.MaxPool2D()) -# model.add(tf.keras.layers.Flatten()) -# model.add(tf.keras.layers.Dense(1024, activation='relu')) -# model.add(tf.keras.layers.Dropout(0.1)) -# model.add(tf.keras.layers.Dense(512, activation='relu')) -# model.add(tf.keras.layers.Dropout(0.1)) -# model.add(tf.keras.layers.Dense(512, activation='relu')) -# model.add(tf.keras.layers.Dropout(0.1)) -# model.add(tf.keras.layers.Dense(20, activation='softmax')) -# model.compile(optimizer='sgd', -# loss=tf.losses.SparseCategoricalCrossentropy( -# from_logits=False), -# metrics=['accuracy']) -# model.load_weights('./models/checkpoint') -# return model - - -# model = age_model() +def age_model(): + model = tf.keras.Sequential() + model.add(tf.keras.layers.Conv2D( + 64, 3, activation='relu', input_shape=(200, 200, 3))) + model.add(tf.keras.layers.MaxPool2D()) + model.add(tf.keras.layers.Conv2D(128, 3, activation='relu')) + model.add(tf.keras.layers.MaxPool2D()) + model.add(tf.keras.layers.Conv2D(256, 3, activation='relu')) + model.add(tf.keras.layers.MaxPool2D()) + model.add(tf.keras.layers.Flatten()) + model.add(tf.keras.layers.Dense(1024, activation='relu')) + model.add(tf.keras.layers.Dropout(0.1)) + model.add(tf.keras.layers.Dense(512, activation='relu')) + model.add(tf.keras.layers.Dropout(0.1)) + model.add(tf.keras.layers.Dense(512, activation='relu')) + model.add(tf.keras.layers.Dropout(0.1)) + model.add(tf.keras.layers.Dense(20, activation='softmax')) + model.compile(optimizer='sgd', + loss=tf.losses.SparseCategoricalCrossentropy( + from_logits=False), + metrics=['accuracy']) + model.load_weights('./models/checkpoint') + return model + + +model = age_model() def signup(request): @@ -244,10 +244,10 @@ def form(request): # return render(request, 'webcam.html') -@ csrf_exempt -def save_form(request): - if request.method == 'POST': - pass +# @ csrf_exempt +# def save_form(request): +# if request.method == 'POST': +# pass @csrf_exempt def save_formdata(request):