Spaces:
Runtime error
Runtime error
fix: correct image handling in simple_prediction function and add debug prints for image types
Browse files
app.py
CHANGED
|
@@ -173,6 +173,9 @@ register_model_with_metadata(
|
|
| 173 |
)
|
| 174 |
|
| 175 |
def preprocess_simple_prediction(image):
|
|
|
|
|
|
|
|
|
|
| 176 |
# The simple_prediction function expects a PIL image (filepath is handled internally)
|
| 177 |
return image
|
| 178 |
|
|
@@ -195,7 +198,7 @@ def simple_prediction(img):
|
|
| 195 |
im = load_image(img)
|
| 196 |
|
| 197 |
result = client.predict(
|
| 198 |
-
input_image=handle_file(
|
| 199 |
api_name="/simple_predict"
|
| 200 |
)
|
| 201 |
return result
|
|
@@ -574,7 +577,7 @@ demo = gr.TabbedInterface(
|
|
| 574 |
],
|
| 575 |
title="Deepfake Detection & Forensics Tools",
|
| 576 |
theme=None,
|
| 577 |
-
|
| 578 |
)
|
| 579 |
|
| 580 |
if __name__ == "__main__":
|
|
|
|
| 173 |
)
|
| 174 |
|
| 175 |
def preprocess_simple_prediction(image):
|
| 176 |
+
print(type(image))
|
| 177 |
+
im = load_image(image)
|
| 178 |
+
print(type(im))
|
| 179 |
# The simple_prediction function expects a PIL image (filepath is handled internally)
|
| 180 |
return image
|
| 181 |
|
|
|
|
| 198 |
im = load_image(img)
|
| 199 |
|
| 200 |
result = client.predict(
|
| 201 |
+
input_image=handle_file(img),
|
| 202 |
api_name="/simple_predict"
|
| 203 |
)
|
| 204 |
return result
|
|
|
|
| 577 |
],
|
| 578 |
title="Deepfake Detection & Forensics Tools",
|
| 579 |
theme=None,
|
| 580 |
+
|
| 581 |
)
|
| 582 |
|
| 583 |
if __name__ == "__main__":
|