Update app.py
Browse files
app.py
CHANGED
|
@@ -24,19 +24,19 @@ clf_1 = pipeline(model=model_1, task="image-classification", image_processor=ima
|
|
| 24 |
|
| 25 |
# Load the second model
|
| 26 |
model_2_path = "Heem2/AI-vs-Real-Image-Detection"
|
| 27 |
-
clf_2 = pipeline("image-classification", model=model_2_path)
|
| 28 |
|
| 29 |
# Load additional models
|
| 30 |
models = ["Organika/sdxl-detector", "cmckinle/sdxl-flux-detector"]
|
| 31 |
|
| 32 |
# Load the third and fourth models
|
| 33 |
-
feature_extractor_3 = AutoFeatureExtractor.from_pretrained(models[0])
|
| 34 |
model_3 = AutoModelForImageClassification.from_pretrained(models[0]).to(device)
|
| 35 |
|
| 36 |
-
feature_extractor_4 = AutoFeatureExtractor.from_pretrained(models[1])
|
| 37 |
model_4 = AutoModelForImageClassification.from_pretrained(models[1]).to(device)
|
| 38 |
|
| 39 |
-
model_5 = load_model("large_model_3lakh_v1.h5")
|
| 40 |
# Define class names for all models
|
| 41 |
class_names_1 = ['artificial', 'real']
|
| 42 |
class_names_2 = ['AI Image', 'Real Image']
|
|
|
|
| 24 |
|
| 25 |
# Load the second model
|
| 26 |
model_2_path = "Heem2/AI-vs-Real-Image-Detection"
|
| 27 |
+
clf_2 = pipeline("image-classification", model=model_2_path, device=device)
|
| 28 |
|
| 29 |
# Load additional models
|
| 30 |
models = ["Organika/sdxl-detector", "cmckinle/sdxl-flux-detector"]
|
| 31 |
|
| 32 |
# Load the third and fourth models
|
| 33 |
+
feature_extractor_3 = AutoFeatureExtractor.from_pretrained(models[0], device=device)
|
| 34 |
model_3 = AutoModelForImageClassification.from_pretrained(models[0]).to(device)
|
| 35 |
|
| 36 |
+
feature_extractor_4 = AutoFeatureExtractor.from_pretrained(models[1], device=device)
|
| 37 |
model_4 = AutoModelForImageClassification.from_pretrained(models[1]).to(device)
|
| 38 |
|
| 39 |
+
model_5 = load_model("large_model_3lakh_v1.h5", device=device)
|
| 40 |
# Define class names for all models
|
| 41 |
class_names_1 = ['artificial', 'real']
|
| 42 |
class_names_2 = ['AI Image', 'Real Image']
|