LPX55
commited on
Commit
·
f5d6264
1
Parent(s):
30cd7dd
Refine UI layout and GOAT inference call
Browse files- Add margin and padding classes to improve results display layout
- Modify GOAT inference function to handle image input more flexibly
- Add print statement for debugging image input in GOAT inference
- app.py +6 -6
- utils/goat.py +3 -2
app.py
CHANGED
@@ -201,25 +201,25 @@ def generate_results_html(results):
|
|
201 |
html_content = f"""
|
202 |
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
|
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[0][3]}</p>
|
208 |
</div>
|
209 |
<div class="col">
|
210 |
-
<h5>ViT/AI-vs-Real <span class="badge badge-secondary">M2</span></h5>
|
211 |
<p>{results[1][3]}</p>
|
212 |
</div>
|
213 |
<div class="col">
|
214 |
-
<h5>Swin/SDXL <span class="badge badge-secondary">M3</span></h5>
|
215 |
<p>{results[2][3]}</p>
|
216 |
</div>
|
217 |
<div class="col">
|
218 |
-
<h5>Swin/SDXL-FLUX <span class="badge badge-secondary">M4</span></h5>
|
219 |
<p>{results[3][3]}</p>
|
220 |
</div>
|
221 |
<div class="col">
|
222 |
-
<h5>GOAT <span class="badge badge-secondary">M5</span></h5>
|
223 |
<p>{results[4][3]}</p>
|
224 |
</div>
|
225 |
</div>
|
|
|
201 |
html_content = f"""
|
202 |
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
|
203 |
<div class="container">
|
204 |
+
<div class="row mt-4 px-2">
|
205 |
<div class="col">
|
206 |
+
<h5>SwinV2/detect <span class="badge badge-secondary ml-1">M1</span></h5>
|
207 |
<p>{results[0][3]}</p>
|
208 |
</div>
|
209 |
<div class="col">
|
210 |
+
<h5>ViT/AI-vs-Real <span class="badge badge-secondary ml-1">M2</span></h5>
|
211 |
<p>{results[1][3]}</p>
|
212 |
</div>
|
213 |
<div class="col">
|
214 |
+
<h5>Swin/SDXL <span class="badge badge-secondary ml-1">M3</span></h5>
|
215 |
<p>{results[2][3]}</p>
|
216 |
</div>
|
217 |
<div class="col">
|
218 |
+
<h5>Swin/SDXL-FLUX <span class="badge badge-secondary ml-1">M4</span></h5>
|
219 |
<p>{results[3][3]}</p>
|
220 |
</div>
|
221 |
<div class="col">
|
222 |
+
<h5>GOAT <span class="badge badge-secondary ml-1">M5</span></h5>
|
223 |
<p>{results[4][3]}</p>
|
224 |
</div>
|
225 |
</div>
|
utils/goat.py
CHANGED
@@ -2,10 +2,11 @@ import os
|
|
2 |
import requests
|
3 |
import json
|
4 |
|
5 |
-
def call_inference(
|
6 |
files = {
|
7 |
-
'image': ('image.jpg',
|
8 |
}
|
|
|
9 |
|
10 |
response = requests.post(
|
11 |
"https://aiwb-sightmodel.web.val.run",
|
|
|
2 |
import requests
|
3 |
import json
|
4 |
|
5 |
+
def call_inference(img):
|
6 |
files = {
|
7 |
+
'image': ('image.jpg', img, 'image/jpeg')
|
8 |
}
|
9 |
+
print(img)
|
10 |
|
11 |
response = requests.post(
|
12 |
"https://aiwb-sightmodel.web.val.run",
|