Update app.py
Browse files
app.py
CHANGED
|
@@ -181,6 +181,7 @@ def predict_image(img, confidence_threshold):
|
|
| 181 |
response5 = response5_raw
|
| 182 |
print(response5)
|
| 183 |
label_5 = f"Result: {response5}"
|
|
|
|
| 184 |
except Exception as e:
|
| 185 |
label_5 = f"Error: {str(e)}"
|
| 186 |
|
|
@@ -192,7 +193,8 @@ def predict_image(img, confidence_threshold):
|
|
| 192 |
"Swin/SDXL-FLUX": label_4,
|
| 193 |
"GOAT": label_5
|
| 194 |
}
|
| 195 |
-
|
|
|
|
| 196 |
|
| 197 |
# Define a function to generate the HTML content
|
| 198 |
def generate_results_html(results):
|
|
@@ -201,23 +203,23 @@ def generate_results_html(results):
|
|
| 201 |
<div class="container">
|
| 202 |
<div class="row mt-4">
|
| 203 |
<div class="col">
|
| 204 |
-
<h5>SwinV2/detect</h5>
|
| 205 |
<p>{results.get("SwinV2/detect", "N/A")}</p>
|
| 206 |
</div>
|
| 207 |
<div class="col">
|
| 208 |
-
<h5>ViT/AI-vs-Real</h5>
|
| 209 |
<p>{results.get("ViT/AI-vs-Real", "N/A")}</p>
|
| 210 |
</div>
|
| 211 |
<div class="col">
|
| 212 |
-
<h5>Swin/SDXL</h5>
|
| 213 |
<p>{results.get("Swin/SDXL", "N/A")}</p>
|
| 214 |
</div>
|
| 215 |
<div class="col">
|
| 216 |
-
<h5>Swin/SDXL-FLUX</h5>
|
| 217 |
<p>{results.get("Swin/SDXL-FLUX", "N/A")}</p>
|
| 218 |
</div>
|
| 219 |
<div class="col">
|
| 220 |
-
<h5>GOAT</h5>
|
| 221 |
<p>{results.get("GOAT", "N/A")}</p>
|
| 222 |
</div>
|
| 223 |
</div>
|
|
|
|
| 181 |
response5 = response5_raw
|
| 182 |
print(response5)
|
| 183 |
label_5 = f"Result: {response5}"
|
| 184 |
+
result_5output = [5, 0.0, 0.0, 'MAINTENANCE']
|
| 185 |
except Exception as e:
|
| 186 |
label_5 = f"Error: {str(e)}"
|
| 187 |
|
|
|
|
| 193 |
"Swin/SDXL-FLUX": label_4,
|
| 194 |
"GOAT": label_5
|
| 195 |
}
|
| 196 |
+
combined_outputs = { result_1output, result_2output, result_3output, result_4output, result_5output}
|
| 197 |
+
return img_pil, combined_outputs
|
| 198 |
|
| 199 |
# Define a function to generate the HTML content
|
| 200 |
def generate_results_html(results):
|
|
|
|
| 203 |
<div class="container">
|
| 204 |
<div class="row mt-4">
|
| 205 |
<div class="col">
|
| 206 |
+
<h5>SwinV2/detect <span class="badge badge-secondary">M1</span></h5>
|
| 207 |
<p>{results.get("SwinV2/detect", "N/A")}</p>
|
| 208 |
</div>
|
| 209 |
<div class="col">
|
| 210 |
+
<h5>ViT/AI-vs-Real <span class="badge badge-secondary">M2</span></h5>
|
| 211 |
<p>{results.get("ViT/AI-vs-Real", "N/A")}</p>
|
| 212 |
</div>
|
| 213 |
<div class="col">
|
| 214 |
+
<h5>Swin/SDXL <span class="badge badge-secondary">M3</span></h5>
|
| 215 |
<p>{results.get("Swin/SDXL", "N/A")}</p>
|
| 216 |
</div>
|
| 217 |
<div class="col">
|
| 218 |
+
<h5>Swin/SDXL-FLUX <span class="badge badge-secondary">M4</span></h5>
|
| 219 |
<p>{results.get("Swin/SDXL-FLUX", "N/A")}</p>
|
| 220 |
</div>
|
| 221 |
<div class="col">
|
| 222 |
+
<h5>GOAT <span class="badge badge-secondary">M5</span></h5>
|
| 223 |
<p>{results.get("GOAT", "N/A")}</p>
|
| 224 |
</div>
|
| 225 |
</div>
|