DariusAf / MesoNet

"MesoNet: a Compact Facial Video Forgery Detection Network" (D. Afchar, V. Nozick) - IEEE WIFS 2018
Apache License 2.0
251 stars 112 forks source link

Operation Steps #9

Closed abnishstha closed 5 years ago

abnishstha commented 5 years ago

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.

DariusAf commented 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.

abnishstha commented 5 years ago

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)

3 - Predict

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?

DariusAf commented 5 years ago

Again I can only redirect you to the Keras documentation, this really is the base case of prediction :

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.