Computer Vision News - August 2022
15 Detect Graphic Intensity and Power in Videos model.add(Dense(50)) model.add(Activation('sigmoid')) model.add(Dense(2)) model.add(Activation('softmax')) model.compile(loss='mean_squared_error', optimizer='adam',metrics=['accuracy']) Model training epoch = 200 batchS = 500 history = model.fit(np.array(data[0:750]), np.array(target[0:750]), epochs=epoch, validation_data=(np.array(data[750:]), np.array(target[750:])), batch_size=batchS, verbose=2) Train on 750 samples, validate on 50 samples Epoch 1/200 - 1s - loss: 0.0408 - acc: 0.9573 - val_loss: 0.0642 - val_acc: 0.9200 (...) Epoch 200/200 - 1s - loss: 0.0293 - acc: 0.9693 - val_loss: 0.0513 - val_acc: 0.9200 Test the model We are going to test themodel with 20 % of the total videos. These videos have not been used to train the network. result = model.evaluate(np.array(data_test), np.array(target_test)) 200/200 [==============================] - 0s 2ms/step Thanks! As always thank you for your great comments feedback and input! Let’s keep this short and see you next month (as always please look over all the amazing magazine content!)
Made with FlippingBook
RkJQdWJsaXNoZXIy NTc3NzU=