Spaces:
Sleeping
Sleeping
Commit ·
f258d44
1
Parent(s): 7011a64
remamed cm_config.yaml
Browse files- app.py +0 -2
- cm.yaml → cm_config.yaml +0 -0
app.py
CHANGED
|
@@ -61,7 +61,6 @@ def load_checkpoint(checkpoint_path: str, device: torch.device) -> Tuple[nn.Modu
|
|
| 61 |
model.load_state_dict(checkpoint['state_dict'])
|
| 62 |
model.to(device)
|
| 63 |
model.eval()
|
| 64 |
-
# The idx_to_class is no longer needed as we hardcode labels
|
| 65 |
return model, {}
|
| 66 |
|
| 67 |
print("--- Loading all models into memory ---")
|
|
@@ -96,7 +95,6 @@ def predict(pil_image, model_name: str):
|
|
| 96 |
output = model(image_tensor)
|
| 97 |
prob = torch.sigmoid(output).item()
|
| 98 |
|
| 99 |
-
# Per user request: Class 0 is "clean", Class 1 is "messy"
|
| 100 |
return {"clean": 1 - prob, "messy": prob}
|
| 101 |
|
| 102 |
iface = gr.Interface(
|
|
|
|
| 61 |
model.load_state_dict(checkpoint['state_dict'])
|
| 62 |
model.to(device)
|
| 63 |
model.eval()
|
|
|
|
| 64 |
return model, {}
|
| 65 |
|
| 66 |
print("--- Loading all models into memory ---")
|
|
|
|
| 95 |
output = model(image_tensor)
|
| 96 |
prob = torch.sigmoid(output).item()
|
| 97 |
|
|
|
|
| 98 |
return {"clean": 1 - prob, "messy": prob}
|
| 99 |
|
| 100 |
iface = gr.Interface(
|
cm.yaml → cm_config.yaml
RENAMED
|
File without changes
|