Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -275,9 +275,11 @@ learn_bias = load_learner('model_bias.pkl')
|
|
275 |
learn_fresh = load_learner('model_fresh.pkl')
|
276 |
|
277 |
# Loads the YOLO Model
|
278 |
-
|
|
|
|
|
279 |
|
280 |
-
def predict_image(img, conf_threshold, iou_threshold):
|
281 |
"""Predicts objects in an image using a YOLOv8 model with adjustable confidence and IOU thresholds."""
|
282 |
results = model.predict(
|
283 |
source=img,
|
@@ -431,9 +433,11 @@ def transform_image(image, func_choice, randomization_check, radius, center_x, c
|
|
431 |
|
432 |
result_localization = model.predict(transformed, save=True)
|
433 |
|
434 |
-
YOLO_image = predict_image(transformed, 0.5, 0.5)
|
|
|
|
|
435 |
|
436 |
-
return transformed, YOLO_image, result_bias_final, result_fresh_final, vector_field, inverse_transformed, inverted_vector_field
|
437 |
|
438 |
|
439 |
demo = gr.Interface(
|
@@ -458,7 +462,9 @@ demo = gr.Interface(
|
|
458 |
],
|
459 |
outputs=[
|
460 |
gr.Image(label="Transformed Image"),
|
461 |
-
gr.Image(label="
|
|
|
|
|
462 |
gr.Label(),
|
463 |
gr.Label(),
|
464 |
gr.Image(label="Gradient Vector Field"),
|
|
|
275 |
learn_fresh = load_learner('model_fresh.pkl')
|
276 |
|
277 |
# Loads the YOLO Model
|
278 |
+
model_bulge = YOLO("bulge_yolo_model.pt")
|
279 |
+
modelv8x = YOLO("yolov8x.pt")
|
280 |
+
modelv8n = YOLO("yolov8n.pt")
|
281 |
|
282 |
+
def predict_image(img, model, conf_threshold, iou_threshold):
|
283 |
"""Predicts objects in an image using a YOLOv8 model with adjustable confidence and IOU thresholds."""
|
284 |
results = model.predict(
|
285 |
source=img,
|
|
|
433 |
|
434 |
result_localization = model.predict(transformed, save=True)
|
435 |
|
436 |
+
YOLO_image = predict_image(transformed, model_bulge, 0.5, 0.5)
|
437 |
+
YOLO_image1 = predict_image(transformed, modelv8n, 0.5, 0.5)
|
438 |
+
YOLO_image2 = predict_image(transformed, modelv8x, 0.5, 0.5)
|
439 |
|
440 |
+
return transformed, YOLO_image, YOLO_image1, YOLO_image2, result_bias_final, result_fresh_final, vector_field, inverse_transformed, inverted_vector_field
|
441 |
|
442 |
|
443 |
demo = gr.Interface(
|
|
|
462 |
],
|
463 |
outputs=[
|
464 |
gr.Image(label="Transformed Image"),
|
465 |
+
gr.Image(label="bulge_model Model Classification"),
|
466 |
+
gr.Image(label="yolov8n Model Classification"),
|
467 |
+
gr.Image(label="yolov8x Model Classification"),
|
468 |
gr.Label(),
|
469 |
gr.Label(),
|
470 |
gr.Image(label="Gradient Vector Field"),
|