Commit
·
8fdd404
1
Parent(s):
736fd4d
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,12 +11,7 @@ yolov7_custom_weights = hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
|
|
| 11 |
|
| 12 |
model = torch.hub.load('Owaiskhan9654/yolov7-1:main',model='custom', path_or_model=yolov7_custom_weights, force_reload=True) # Github repository https://github.com/Owaiskhan9654
|
| 13 |
|
| 14 |
-
def object_detection(
|
| 15 |
-
image: gr.inputs.Image = None,
|
| 16 |
-
model_path: gr.inputs.Dropdown = None,
|
| 17 |
-
image_size: gr.inputs.Slider = 640,
|
| 18 |
-
conf_threshold: gr.inputs.Slider = 0.25,
|
| 19 |
-
iou_threshold: gr.inputs.Slider = 0.45,):
|
| 20 |
|
| 21 |
|
| 22 |
results = model(image)
|
|
@@ -35,14 +30,13 @@ title = "Yolov7 Custom"
|
|
| 35 |
|
| 36 |
# image = gr.inputs.Image(shape=(640, 640), image_mode="RGB", source="upload", label="Upload Image", optional=False)
|
| 37 |
|
| 38 |
-
inputs =
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
]
|
| 46 |
outputs = gr.outputs.Image(type="pil", label="Output Image")
|
| 47 |
outputs_cls = gr.Label(label= "Categories Detected Proportion Statistics" )
|
| 48 |
|
|
|
|
| 11 |
|
| 12 |
model = torch.hub.load('Owaiskhan9654/yolov7-1:main',model='custom', path_or_model=yolov7_custom_weights, force_reload=True) # Github repository https://github.com/Owaiskhan9654
|
| 13 |
|
| 14 |
+
def object_detection(image: gr.inputs.Image = None):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
results = model(image)
|
|
|
|
| 30 |
|
| 31 |
# image = gr.inputs.Image(shape=(640, 640), image_mode="RGB", source="upload", label="Upload Image", optional=False)
|
| 32 |
|
| 33 |
+
inputs = gr.inputs.Image(shape=(640, 640), image_mode="RGB", source="upload", label="Upload Image", optional=False)
|
| 34 |
+
# gr.inputs.Dropdown(["best.pt",],
|
| 35 |
+
# default="best.pt", label="Model"),
|
| 36 |
+
# gr.inputs.Slider(minimum=320, maximum=1280, default=640, step=32, label="Image Size"),
|
| 37 |
+
# gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.25, step=0.05, label="Confidence Threshold"),
|
| 38 |
+
# gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.45, step=0.05, label="IOU Threshold"),
|
| 39 |
+
# ]
|
|
|
|
| 40 |
outputs = gr.outputs.Image(type="pil", label="Output Image")
|
| 41 |
outputs_cls = gr.Label(label= "Categories Detected Proportion Statistics" )
|
| 42 |
|