Spaces:
Runtime error
Runtime error
Commit
·
00b858c
1
Parent(s):
943ae81
Update app.py
Browse files
app.py
CHANGED
@@ -19,18 +19,18 @@ Intrigued? Dive into the world of trading alchemy! 🌌
|
|
19 |
image_path= [['test/1.jpg', 'foduucom/stockmarket-future-prediction', 640, 0.25, 0.45], ['test/2.jpg', 'foduucom/stockmarket-future-prediction', 640, 0.25, 0.45],['test/3.jpg', 'foduucom/stockmarket-future-prediction', 640, 0.25, 0.45]]
|
20 |
|
21 |
# Load YOLO model
|
22 |
-
|
23 |
|
24 |
|
25 |
#############################################################Image Inference############################################################
|
26 |
def yolov8_img_inference(
|
27 |
image: gr.inputs.Image = None,
|
28 |
-
model_path: gr.inputs.Dropdown =
|
29 |
image_size: gr.inputs.Slider = 640,
|
30 |
conf_threshold: gr.inputs.Slider = 0.25,
|
31 |
iou_threshold: gr.inputs.Slider = 0.45
|
32 |
):
|
33 |
-
model = YOLO(model_path
|
34 |
model.overrides['conf'] = conf_threshold
|
35 |
model.overrides['iou']= iou_threshold
|
36 |
model.overrides['agnostic_nms'] = False # NMS class-agnostic
|
|
|
19 |
image_path= [['test/1.jpg', 'foduucom/stockmarket-future-prediction', 640, 0.25, 0.45], ['test/2.jpg', 'foduucom/stockmarket-future-prediction', 640, 0.25, 0.45],['test/3.jpg', 'foduucom/stockmarket-future-prediction', 640, 0.25, 0.45]]
|
20 |
|
21 |
# Load YOLO model
|
22 |
+
model = YOLO("foduucom/stockmarket-future-prediction")
|
23 |
|
24 |
|
25 |
#############################################################Image Inference############################################################
|
26 |
def yolov8_img_inference(
|
27 |
image: gr.inputs.Image = None,
|
28 |
+
model_path: gr.inputs.Dropdown = None,
|
29 |
image_size: gr.inputs.Slider = 640,
|
30 |
conf_threshold: gr.inputs.Slider = 0.25,
|
31 |
iou_threshold: gr.inputs.Slider = 0.45
|
32 |
):
|
33 |
+
model = YOLO(model_path)
|
34 |
model.overrides['conf'] = conf_threshold
|
35 |
model.overrides['iou']= iou_threshold
|
36 |
model.overrides['agnostic_nms'] = False # NMS class-agnostic
|