Spaces:
Build error
Build error
floating point result
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def model_fn(model_dir):
|
|
24 |
def convert_result(pred, class_names=["Real", "Fake"]):
|
25 |
preds = [pred, 1 - pred]
|
26 |
assert len(class_names) == len(preds), "Class / Prediction should have the same length"
|
27 |
-
return {n: p for n, p in zip(class_names, preds)}
|
28 |
|
29 |
def predict_fn(video):
|
30 |
start = time.time()
|
@@ -66,7 +66,6 @@ meta = {"fps": 32,
|
|
66 |
|
67 |
model = model_fn(model_dir)
|
68 |
|
69 |
-
"""
|
70 |
if __name__ == '__main__':
|
71 |
video_path = "examples/nlurbvsozt.mp4"
|
72 |
model = model_fn(model_dir)
|
@@ -84,3 +83,4 @@ demo = gr.Interface(fn=predict_fn, # mapping function from input to output
|
|
84 |
|
85 |
# Launch the demo!
|
86 |
demo.launch(debug=False,) # Hugging face space don't need shareable_links
|
|
|
|
24 |
def convert_result(pred, class_names=["Real", "Fake"]):
|
25 |
preds = [pred, 1 - pred]
|
26 |
assert len(class_names) == len(preds), "Class / Prediction should have the same length"
|
27 |
+
return {n: float(p) for n, p in zip(class_names, preds)}
|
28 |
|
29 |
def predict_fn(video):
|
30 |
start = time.time()
|
|
|
66 |
|
67 |
model = model_fn(model_dir)
|
68 |
|
|
|
69 |
if __name__ == '__main__':
|
70 |
video_path = "examples/nlurbvsozt.mp4"
|
71 |
model = model_fn(model_dir)
|
|
|
83 |
|
84 |
# Launch the demo!
|
85 |
demo.launch(debug=False,) # Hugging face space don't need shareable_links
|
86 |
+
"""
|