Spaces:
Sleeping
Sleeping
hakandinger
commited on
Commit
·
3bec35d
1
Parent(s):
f710aa2
-Fixed video upload height (300px) for stable layout
Browse files
app.py
CHANGED
|
@@ -663,7 +663,7 @@ with gr.Blocks(title="Yüz Tanıma Sistemi", theme=gr.themes.Soft()) as demo:
|
|
| 663 |
|
| 664 |
with gr.Row():
|
| 665 |
with gr.Column():
|
| 666 |
-
video_input = gr.Video(label="📁 Yerel Video Yükle")
|
| 667 |
gr.Markdown("**VEYA**")
|
| 668 |
url_input = gr.Textbox(
|
| 669 |
label="🌐 Video URL'si",
|
|
@@ -675,8 +675,8 @@ with gr.Blocks(title="Yüz Tanıma Sistemi", theme=gr.themes.Soft()) as demo:
|
|
| 675 |
process_btn = gr.Button("🚀 İşlemi Başlat", variant="primary", size="lg")
|
| 676 |
status_text = gr.Textbox(label="Durum", interactive=False)
|
| 677 |
|
| 678 |
-
with gr.Column():
|
| 679 |
-
gallery_output = gr.Gallery(label="Tespit Edilen Yüzler", columns=4, height=
|
| 680 |
report_output = gr.Markdown(label="Rapor")
|
| 681 |
|
| 682 |
gr.Markdown("""
|
|
@@ -684,9 +684,7 @@ with gr.Blocks(title="Yüz Tanıma Sistemi", theme=gr.themes.Soft()) as demo:
|
|
| 684 |
- **YouTube**: `https://www.youtube.com/watch?v=xxxxx` veya `https://youtu.be/xxxxx` veya Shorts
|
| 685 |
- **Doğrudan video**: `https://example.com/video.mp4`
|
| 686 |
- Google Drive paylaşım linki çalışmaz (direkt indirme linki gerekir)
|
| 687 |
-
- **Desteklenen formatlar**: MP4, AVI, MOV, MKV, WebM
|
| 688 |
-
|
| 689 |
-
⚠️ **YouTube için**: İlk kullanımda `pip install yt-dlp` komutu gereklidir
|
| 690 |
""")
|
| 691 |
|
| 692 |
process_btn.click(
|
|
@@ -698,11 +696,23 @@ with gr.Blocks(title="Yüz Tanıma Sistemi", theme=gr.themes.Soft()) as demo:
|
|
| 698 |
with gr.Tab("🔍 Yüz Karşılaştır"):
|
| 699 |
gr.Markdown("İki yüz görselini yükleyin ve benzerliklerini kontrol edin")
|
| 700 |
with gr.Row():
|
| 701 |
-
|
| 702 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 703 |
|
| 704 |
compare_btn = gr.Button("⚖️ Karşılaştır", variant="primary")
|
| 705 |
-
compare_result = gr.Textbox(label="Sonuç", interactive=False)
|
| 706 |
|
| 707 |
compare_btn.click(
|
| 708 |
fn=compare_two_faces,
|
|
@@ -734,26 +744,16 @@ with gr.Blocks(title="Yüz Tanıma Sistemi", theme=gr.themes.Soft()) as demo:
|
|
| 734 |
---
|
| 735 |
### 💡 İpuçları
|
| 736 |
- **Frame Atlama**: Daha hızlı işlem için artırın, daha fazla tespit için azaltın
|
| 737 |
-
- **Clustering**: Daha az kişi tespit ediyorsa artırın, fazla tespit ediyorsa azaltın
|
| 738 |
-
- **GPU**: Cuda destekli GPU varsa aktif edin
|
| 739 |
-
- **YouTube**: İlk kullanımda terminalde `pip install yt-dlp` çalıştırın
|
| 740 |
""")
|
| 741 |
|
| 742 |
if __name__ == "__main__":
|
| 743 |
-
|
| 744 |
print("\n" + "="*60)
|
| 745 |
print("🎬 Video Yüz Tanıma Sistemi")
|
| 746 |
print("="*60)
|
| 747 |
|
| 748 |
-
|
| 749 |
-
print("✅ YouTube desteği: AKTİF")
|
| 750 |
-
try:
|
| 751 |
-
print(f" yt-dlp versiyon: {yt_dlp.version.__version__}")
|
| 752 |
-
except:
|
| 753 |
-
print(" yt-dlp versiyon bilgisi alınamadı")
|
| 754 |
-
else:
|
| 755 |
-
print("⚠️ YouTube desteği: KAPALI")
|
| 756 |
-
print(" Kurulum için: pip install yt-dlp")
|
| 757 |
|
| 758 |
print("="*60 + "\n")
|
| 759 |
|
|
|
|
| 663 |
|
| 664 |
with gr.Row():
|
| 665 |
with gr.Column():
|
| 666 |
+
video_input = gr.Video(label="📁 Yerel Video Yükle",height=300)
|
| 667 |
gr.Markdown("**VEYA**")
|
| 668 |
url_input = gr.Textbox(
|
| 669 |
label="🌐 Video URL'si",
|
|
|
|
| 675 |
process_btn = gr.Button("🚀 İşlemi Başlat", variant="primary", size="lg")
|
| 676 |
status_text = gr.Textbox(label="Durum", interactive=False)
|
| 677 |
|
| 678 |
+
with gr.Column(scale=1):
|
| 679 |
+
gallery_output = gr.Gallery(label="Tespit Edilen Yüzler", columns=4, height=500,object_fit="contain")
|
| 680 |
report_output = gr.Markdown(label="Rapor")
|
| 681 |
|
| 682 |
gr.Markdown("""
|
|
|
|
| 684 |
- **YouTube**: `https://www.youtube.com/watch?v=xxxxx` veya `https://youtu.be/xxxxx` veya Shorts
|
| 685 |
- **Doğrudan video**: `https://example.com/video.mp4`
|
| 686 |
- Google Drive paylaşım linki çalışmaz (direkt indirme linki gerekir)
|
| 687 |
+
- **Desteklenen formatlar**: MP4, AVI, MOV, MKV, WebM
|
|
|
|
|
|
|
| 688 |
""")
|
| 689 |
|
| 690 |
process_btn.click(
|
|
|
|
| 696 |
with gr.Tab("🔍 Yüz Karşılaştır"):
|
| 697 |
gr.Markdown("İki yüz görselini yükleyin ve benzerliklerini kontrol edin")
|
| 698 |
with gr.Row():
|
| 699 |
+
with gr.Column(scale=1):
|
| 700 |
+
face1_input = gr.Image(
|
| 701 |
+
label="Yüz 1",
|
| 702 |
+
type="filepath",
|
| 703 |
+
height=300,
|
| 704 |
+
width=300
|
| 705 |
+
)
|
| 706 |
+
with gr.Column(scale=1):
|
| 707 |
+
face2_input = gr.Image(
|
| 708 |
+
label="Yüz 2",
|
| 709 |
+
type="filepath",
|
| 710 |
+
height=300,
|
| 711 |
+
width=300
|
| 712 |
+
)
|
| 713 |
|
| 714 |
compare_btn = gr.Button("⚖️ Karşılaştır", variant="primary")
|
| 715 |
+
compare_result = gr.Textbox(label="Sonuç", interactive=False, lines=3)
|
| 716 |
|
| 717 |
compare_btn.click(
|
| 718 |
fn=compare_two_faces,
|
|
|
|
| 744 |
---
|
| 745 |
### 💡 İpuçları
|
| 746 |
- **Frame Atlama**: Daha hızlı işlem için artırın, daha fazla tespit için azaltın
|
| 747 |
+
- **Clustering**: Daha az kişi tespit ediyorsa artırın, fazla tespit ediyorsa azaltın
|
|
|
|
|
|
|
| 748 |
""")
|
| 749 |
|
| 750 |
if __name__ == "__main__":
|
| 751 |
+
|
| 752 |
print("\n" + "="*60)
|
| 753 |
print("🎬 Video Yüz Tanıma Sistemi")
|
| 754 |
print("="*60)
|
| 755 |
|
| 756 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 757 |
|
| 758 |
print("="*60 + "\n")
|
| 759 |
|