Spaces:
Sleeping
Sleeping
AlshimaaGamalAlsaied
commited on
Commit
·
114c1f0
1
Parent(s):
f4d9741
update
Browse files- app.py +4 -2
- requirements.txt +2 -1
app.py
CHANGED
@@ -3,16 +3,18 @@ import gradio as gr
|
|
3 |
import yolov7
|
4 |
|
5 |
|
6 |
-
|
|
|
7 |
from huggingface_hub import hfapi
|
8 |
|
|
|
9 |
# Images
|
10 |
#torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg', 'zidane.jpg')
|
11 |
#torch.hub.download_url_to_file('https://raw.githubusercontent.com/obss/sahi/main/tests/data/small-vehicles1.jpeg', 'small-vehicles1.jpeg')
|
12 |
|
13 |
def yolov7_inference(
|
14 |
image: gr.inputs.Image = None,
|
15 |
-
model_path: gr.inputs.Dropdown = hfapi(repo_id=f"model_baseline", filename=f"best_baseline.pt"),
|
16 |
image_size: gr.inputs.Slider = 640,
|
17 |
conf_threshold: gr.inputs.Slider = 0.25,
|
18 |
iou_threshold: gr.inputs.Slider = 0.45,
|
|
|
3 |
import yolov7
|
4 |
|
5 |
|
6 |
+
#
|
7 |
+
# from huggingface_hub import hf_hub_download
|
8 |
from huggingface_hub import hfapi
|
9 |
|
10 |
+
|
11 |
# Images
|
12 |
#torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg', 'zidane.jpg')
|
13 |
#torch.hub.download_url_to_file('https://raw.githubusercontent.com/obss/sahi/main/tests/data/small-vehicles1.jpeg', 'small-vehicles1.jpeg')
|
14 |
|
15 |
def yolov7_inference(
|
16 |
image: gr.inputs.Image = None,
|
17 |
+
model_path: gr.inputs.Dropdown = hfapi(repo_id=f"alshimaa/model_baseline", filename=f"best_baseline.pt"),
|
18 |
image_size: gr.inputs.Slider = 640,
|
19 |
conf_threshold: gr.inputs.Slider = 0.25,
|
20 |
iou_threshold: gr.inputs.Slider = 0.45,
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
gradio
|
2 |
torch
|
3 |
-
yolov7detect
|
|
|
|
1 |
gradio
|
2 |
torch
|
3 |
+
yolov7detect
|
4 |
+
hfapi
|