mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-24 06:14:55 +08:00
fix gr.Examples output type mismatch by adding separate function for examples
This commit is contained in:
parent
f87b08feee
commit
34af6d27fa
8
app.py
8
app.py
@ -1,4 +1,4 @@
|
||||
# Ackownledgement: https://huggingface.co/spaces/kadirnar/Yolov10/blob/main/app.py
|
||||
# Acknowledgement: https://huggingface.co/spaces/kadirnar/Yolov10/blob/main/app.py
|
||||
# Thanks to @kadirnar
|
||||
|
||||
import gradio as gr
|
||||
@ -41,6 +41,10 @@ def yolov10_inference_video(video, model_path, image_size, conf_threshold):
|
||||
|
||||
return None, output_video_path
|
||||
|
||||
def yolov10_inference_for_examples(image, model_path, image_size, conf_threshold):
|
||||
annotated_image, _ = yolov10_inference(image, model_path, image_size, conf_threshold)
|
||||
return annotated_image
|
||||
|
||||
def app():
|
||||
with gr.Blocks():
|
||||
with gr.Row():
|
||||
@ -126,7 +130,7 @@ def app():
|
||||
0.25,
|
||||
],
|
||||
],
|
||||
fn=yolov10_inference,
|
||||
fn=yolov10_inference_for_examples,
|
||||
inputs=[
|
||||
image,
|
||||
model_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user