Delete app.py
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041# -*- coding: utf-8 -*-"""day1deployobjectdetection.ipynb
Automatically generated by Colab.
Original file is located at https://colab.research.google.com/drive/1CwEhyaDiq5FTGAq5PgIHhd1K_mZygEub"""
from ultralytics import YOLOimport cv2import timeimport gradio as grfrom PIL import Imageimport numpy as np
# create the modelmodel = YOLO("yolov8n.pt")
# create function to detect the imagedef detectImage(image): # if the image is none, then skip it if image is None: return None
# get the result results = model.predict(source=image, save=False)
# create the boxes resultImage = results[0].plot()
return Image.fromarray(resultImage)
# create the website applicationapp = gr.Interface( fn=detectImage, inputs=gr.Image(type="numpy", label="just upload the some random image"), outputs=gr.Image(type="pil", label="the result of the object detection goes here"), title="my object detection using yolo", description="just upload a random image and then wait until the object detection result show")app.pyDeleted-41