Closed abnishstha closed 5 years ago
Hi,
To use the model, I recommend you take a look at the keras documentation. The model
attribute of the classifiers are standard keras models you can use any way you like.
As for the face extraction, this step is not necessary, you could use your own face extractor. The overall idea is that it does a first pass on the video to extract the faces position and geometry (position x and y, length of the face, rotation), and then the FaceBatchGenerator is used to iterate through all of the faces, to create a batch of images that are given to the classifier for prediction, ultimately the predictions are aggregated and printed.
Thanks @DariusAf. Just starting to play around your program. I go this result for your provided test image set, which had 2 images each for df and real. I didn't understand the output. What does it really signify (in regards to predicting the tampered images in the set)
X, y = generator.next() print('Predicted :', classifier.predict(X), '\nReal class :', y)
Found 4 images belonging to 2 classes. Predicted : [[0.99782073]] Real class : [1.]
I am involving your model for one of my uni projects. Is there any other way I can contact you other than logging on issue?
Again I can only redirect you to the Keras documentation, this really is the base case of prediction :
generator.next
samples a random batch of images and labels from the given directory ;classifier.predict
computes the network output for each image of the batch.That was a minimal example code to show that the model is usable as a standard keras model. For face prediction from videos, you can use the compute_accuracy
function that extracts faces from the videos, predict and aggregate the results.
Hi @DariusAf It would be a good idea to create a operation steps for your model. For beginner like me, I really don't know where to start.