Update app.py
Browse files
app.py
CHANGED
|
@@ -64,22 +64,22 @@ class NumpyEncoder(json.JSONEncoder):
|
|
| 64 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 65 |
|
| 66 |
# Model paths and class names (copied from app_mcp.py)
|
|
|
|
| 67 |
MODEL_PATHS = {
|
| 68 |
"model_1": "LPX55/detection-model-1-ONNX",
|
| 69 |
"model_2": "LPX55/detection-model-2-ONNX",
|
| 70 |
"model_3": "LPX55/detection-model-3-ONNX",
|
| 71 |
-
"model_4": "cmckinle/sdxl-flux-detector_v1.1",
|
| 72 |
"model_5": "LPX55/detection-model-5-ONNX",
|
| 73 |
"model_6": "LPX55/detection-model-6-ONNX",
|
| 74 |
"model_7": "LPX55/detection-model-7-ONNX",
|
| 75 |
"model_8": "aiwithoutborders-xyz/CommunityForensics-DeepfakeDet-ViT"
|
| 76 |
}
|
| 77 |
|
|
|
|
| 78 |
CLASS_NAMES = {
|
| 79 |
"model_1": ['artificial', 'real'],
|
| 80 |
"model_2": ['AI Image', 'Real Image'],
|
| 81 |
"model_3": ['artificial', 'human'],
|
| 82 |
-
"model_4": ['AI', 'Real'],
|
| 83 |
"model_5": ['Realism', 'Deepfake'],
|
| 84 |
"model_6": ['ai_gen', 'human'],
|
| 85 |
"model_7": ['Fake', 'Real'],
|
|
@@ -87,8 +87,6 @@ CLASS_NAMES = {
|
|
| 87 |
}
|
| 88 |
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
def register_model_with_metadata(model_id, model, preprocess, postprocess, class_names, display_name, contributor, model_path, architecture=None, dataset=None):
|
| 93 |
entry = ModelEntry(model, preprocess, postprocess, class_names, display_name=display_name, contributor=contributor, model_path=model_path, architecture=architecture, dataset=dataset)
|
| 94 |
MODEL_REGISTRY[model_id] = entry
|
|
|
|
| 64 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 65 |
|
| 66 |
# Model paths and class names (copied from app_mcp.py)
|
| 67 |
+
# MODEL_PATHS (model_4 removed)
|
| 68 |
MODEL_PATHS = {
|
| 69 |
"model_1": "LPX55/detection-model-1-ONNX",
|
| 70 |
"model_2": "LPX55/detection-model-2-ONNX",
|
| 71 |
"model_3": "LPX55/detection-model-3-ONNX",
|
|
|
|
| 72 |
"model_5": "LPX55/detection-model-5-ONNX",
|
| 73 |
"model_6": "LPX55/detection-model-6-ONNX",
|
| 74 |
"model_7": "LPX55/detection-model-7-ONNX",
|
| 75 |
"model_8": "aiwithoutborders-xyz/CommunityForensics-DeepfakeDet-ViT"
|
| 76 |
}
|
| 77 |
|
| 78 |
+
# CLASS_NAMES (model_4 removed)
|
| 79 |
CLASS_NAMES = {
|
| 80 |
"model_1": ['artificial', 'real'],
|
| 81 |
"model_2": ['AI Image', 'Real Image'],
|
| 82 |
"model_3": ['artificial', 'human'],
|
|
|
|
| 83 |
"model_5": ['Realism', 'Deepfake'],
|
| 84 |
"model_6": ['ai_gen', 'human'],
|
| 85 |
"model_7": ['Fake', 'Real'],
|
|
|
|
| 87 |
}
|
| 88 |
|
| 89 |
|
|
|
|
|
|
|
| 90 |
def register_model_with_metadata(model_id, model, preprocess, postprocess, class_names, display_name, contributor, model_path, architecture=None, dataset=None):
|
| 91 |
entry = ModelEntry(model, preprocess, postprocess, class_names, display_name=display_name, contributor=contributor, model_path=model_path, architecture=architecture, dataset=dataset)
|
| 92 |
MODEL_REGISTRY[model_id] = entry
|