Merge pull request #16 from JSchmie/gradio_app

Gradio app
This commit is contained in:
Jacob Schmieder
2023-10-04 14:45:11 +02:00
committed by GitHub
6 changed files with 46 additions and 179 deletions
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 38 KiB

+7 -4
View File
@@ -34,7 +34,6 @@ Usage:
import json import json
import os import os
from tkinter import CURRENT
import gradio as gr import gradio as gr
from tqdm import tqdm from tqdm import tqdm
@@ -118,7 +117,7 @@ class GradioTranscriptionInterface:
out = '' out = ''
out_dict = {} out_dict = {}
for i, r in enumerate(result): for i, r in enumerate(result):
out += f"TRANSCRIPT {i} FOR ({source_names[i]}):\n\n" out += f"TRANSCRIPT FOR {source_names[i]}:\n\n"
out += str(r) out += str(r)
out += "\n\n" out += "\n\n"
@@ -159,7 +158,7 @@ class GradioTranscriptionInterface:
out = '' out = ''
for i, res in enumerate(result): for i, res in enumerate(result):
out += f"TRANSCRIPT {i} FOR ({source_names[i]}):\n\n" out += f"TRANSCRIPT FOR {source_names[i]}:\n\n"
out += str(res) out += str(res)
out += "\n\n" out += "\n\n"
@@ -354,6 +353,10 @@ def gradio_Interface(model : Scraibe = None):
# Define components # Define components
hname = os.path.join(CURRENT_PATH, "header.html") hname = os.path.join(CURRENT_PATH, "header.html")
header = open(hname, "r").read() header = open(hname, "r").read()
# ugly hack to get the logo to work
header = header.replace("/file=logo.svg", f"/file={CURRENT_PATH}/logo.svg" )
gr.HTML(header, visible= True, show_label=False) gr.HTML(header, visible= True, show_label=False)
with gr.Row(): with gr.Row():
@@ -385,7 +388,7 @@ def gradio_Interface(model : Scraibe = None):
interactive= True, visible= False) interactive= True, visible= False)
video1 = gr.Video(source="upload", type="filepath", label="Upload Video", video1 = gr.Video(source="upload", type="filepath", label="Upload Video",
interactive= True, visible= False) interactive= True, visible= False)
video2 = gr.Video(source="webcam", label="Record Video", type="filepath", video2 = gr.Video(source="webcam", label="Record Video", type="filepath",include_audio= True,
interactive= True, visible= False) interactive= True, visible= False)
file_in = gr.Files(label="Upload File or Files", interactive= True, visible= False) file_in = gr.Files(label="Upload File or Files", interactive= True, visible= False)
+1 -1
View File
@@ -54,7 +54,7 @@
<h1>ScrAIbe</h1> <h1>ScrAIbe</h1>
<div class="logo-container"> <div class="logo-container">
<a href="https://www.kida-bmel.de/"> <!-- Replace with your actual URL --> <a href="https://www.kida-bmel.de/"> <!-- Replace with your actual URL -->
<img src="file/Logo_KIDA_bmel_green.svg" alt="KIDA Logo" class="logo"> <img src="/file=logo.svg" alt="KIDA Logo" class="logo">
</a> </a>
</div> </div>
</div> </div>
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 29 KiB

-2
View File
@@ -1,7 +1,5 @@
import json import json
import time import time
from traceback import print_stack
from typing import Union from typing import Union
+1 -1
View File
@@ -50,7 +50,7 @@ if __name__ == "__main__":
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10'], 'Programming Language :: Python :: 3.10'],
keywords = ['transcription', 'speech recognition', 'whisper', 'pyannote', 'audio', keywords = ['transcription', 'speech recognition', 'whisper', 'pyannote', 'audio', 'ScrAIbe', 'scraibe',
'speech-to-text', 'speech-to-text transcription', 'speech-to-text recognition', 'speech-to-text', 'speech-to-text transcription', 'speech-to-text recognition',
'voice-to-speech'], 'voice-to-speech'],
package_data={'scraibe.app' : ["*.html", "*.svg"]}, package_data={'scraibe.app' : ["*.html", "*.svg"]},