diff --git a/app.py b/app.py index 7ee2e9b4..6a51e352 100644 --- a/app.py +++ b/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, @@ -149,4 +153,4 @@ with gradio_app: with gr.Column(): app() -gradio_app.launch(debug=True) \ No newline at end of file +gradio_app.launch(debug=True)