Spaces:
Sleeping
Sleeping
Upload predict.py
Browse files- src/predict.py +10 -0
src/predict.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# predict.py placeholder
|
2 |
+
from tensorflow.keras.models import load_model
|
3 |
+
|
4 |
+
def load_trained_model(path):
|
5 |
+
return load_model(path)
|
6 |
+
|
7 |
+
def predict_violence(model, processed_frame):
|
8 |
+
prediction = model.predict(processed_frame)
|
9 |
+
return prediction[0][0]
|
10 |
+
|