Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ warnings.filterwarnings('ignore')
|
|
19 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
20 |
|
21 |
sbcl = create_model("Weights/weights.tar")
|
22 |
-
sbcl.to(device)
|
23 |
|
24 |
face_detector = get_model("resnet50_2020-07-20", max_size=1024, device=device)
|
25 |
face_detector.eval()
|
@@ -153,9 +153,9 @@ with gr.Blocks(title="Deepfake Detection CL", theme='upsatwal/mlsc_tiet', css=""
|
|
153 |
gr.Examples(
|
154 |
examples=examples,
|
155 |
inputs=input_image,
|
156 |
-
outputs=output_image,
|
157 |
fn=predict_image,
|
158 |
-
cache_examples=
|
159 |
)
|
160 |
btn.click(predict_image, inputs=input_image, outputs=[label_probs, output_image], api_name="/predict_image")
|
161 |
|
@@ -175,7 +175,7 @@ with gr.Blocks(title="Deepfake Detection CL", theme='upsatwal/mlsc_tiet', css=""
|
|
175 |
gr.Examples(
|
176 |
examples=examples_videos,
|
177 |
inputs=input_video,
|
178 |
-
outputs=output_image_video,
|
179 |
fn=predict_video,
|
180 |
cache_examples=True,
|
181 |
)
|
|
|
19 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
20 |
|
21 |
sbcl = create_model("Weights/weights.tar")
|
22 |
+
sbcl.to(device)
|
23 |
|
24 |
face_detector = get_model("resnet50_2020-07-20", max_size=1024, device=device)
|
25 |
face_detector.eval()
|
|
|
153 |
gr.Examples(
|
154 |
examples=examples,
|
155 |
inputs=input_image,
|
156 |
+
outputs=[label_probs, output_image],
|
157 |
fn=predict_image,
|
158 |
+
cache_examples=True,
|
159 |
)
|
160 |
btn.click(predict_image, inputs=input_image, outputs=[label_probs, output_image], api_name="/predict_image")
|
161 |
|
|
|
175 |
gr.Examples(
|
176 |
examples=examples_videos,
|
177 |
inputs=input_video,
|
178 |
+
outputs=[label_probs_video, output_image_video],
|
179 |
fn=predict_video,
|
180 |
cache_examples=True,
|
181 |
)
|