Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,12 +3,13 @@ import requests
|
|
| 3 |
from PIL import Image
|
| 4 |
from io import BytesIO
|
| 5 |
import torch
|
| 6 |
-
from transformers import AutoModelForImageClassification,
|
|
|
|
| 7 |
|
| 8 |
app = FastAPI()
|
| 9 |
|
| 10 |
model_name = "prithivMLmods/open-deepfake-detection"
|
| 11 |
-
extractor =
|
| 12 |
model = AutoModelForImageClassification.from_pretrained(model_name)
|
| 13 |
|
| 14 |
@app.post("/analyze")
|
|
|
|
| 3 |
from PIL import Image
|
| 4 |
from io import BytesIO
|
| 5 |
import torch
|
| 6 |
+
from transformers import AutoModelForImageClassification, AutoImageProcessor
|
| 7 |
+
|
| 8 |
|
| 9 |
app = FastAPI()
|
| 10 |
|
| 11 |
model_name = "prithivMLmods/open-deepfake-detection"
|
| 12 |
+
extractor = AutoImageProcessor.from_pretrained(model_name)
|
| 13 |
model = AutoModelForImageClassification.from_pretrained(model_name)
|
| 14 |
|
| 15 |
@app.post("/analyze")
|