mhmtordu commited on
Commit
8dd9433
·
verified ·
1 Parent(s): a304b7f

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from ultralytics import YOLO
3
+
4
+ # Modeli yükle
5
+ model = YOLO("yolov8n.pt") # Küçük ve hızlı YOLOv8 modeli
6
+
7
+ # Video işleme fonksiyonu
8
+ def process_video(video):
9
+ results = model(video) # Videoyu modelle işleyin
10
+ output_path = "output.mp4"
11
+ results.save(output_path) # İşlenmiş videoyu kaydedin
12
+ return output_path
13
+
14
+ # Gradio arayüzü
15
+ iface = gr.Interface(
16
+ fn=process_video,
17
+ inputs=gr.Video(type="mp4"),
18
+ outputs=gr.Video(),
19
+ title="Nesne Tanıma Aracı",
20
+ description="Videodaki nesneleri tanıyan bir yapay zeka aracı."
21
+ )
22
+
23
+ iface.launch()