pedrofrodenas / Violence-Detection-CNN-LSTM

Violence Detection tutorial using pre-trained CNN and LSTM
GNU General Public License v3.0
29 stars 16 forks source link

Is there code that demonstrates how to use the trained model? #3

Open edwincm opened 4 years ago

pedrofrodenas commented 3 years ago

No sorry, this repo is a bit outdated, it is a old code not structured correctly.

spacewalk01 commented 3 years ago

Try the following code for inference

frames = get_frames("your dir", "fi324_xvid.avi")
transfer_values = image_model_transfer.predict(frames)    

model.predict(transfer_values.reshape((1,20,-1)))

which returns

array([[0.9947391, 0.0052609]], dtype=float32)