Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,34 +19,10 @@ ignore_warnings()
|
|
19 |
from transformers.utils import logging
|
20 |
logging.set_verbosity_error()
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
od_pipe = pipeline("object-detection", "facebook/detr-resnet-50")
|
28 |
tts_pipe = pipeline("text-to-speech",
|
29 |
model="kakao-enterprise/vits-ljs")
|
30 |
|
31 |
-
|
32 |
-
def get_pipeline_prediction(pil_image):
|
33 |
-
|
34 |
-
pipeline_output = od_pipe(pil_image)
|
35 |
-
|
36 |
-
processed_image = render_results_in_image(pil_image,
|
37 |
-
pipeline_output)
|
38 |
-
|
39 |
-
text = summarize_predictions_natural_language(pipeline_output)
|
40 |
-
print(text)
|
41 |
-
narrated_text = tts_pipe(text)
|
42 |
-
|
43 |
-
#print (narrated_text)
|
44 |
-
print(narrated_text["audio"][0])
|
45 |
-
print (narrated_text["sampling_rate"])
|
46 |
-
return processed_image, (narrated_text["sampling_rate"], narrated_text["audio"][0] )
|
47 |
-
#return processed_image
|
48 |
-
|
49 |
-
|
50 |
demo = gr.Interface(
|
51 |
fn=get_predictions,
|
52 |
inputs=gr.Image(label="Input image",
|
|
|
19 |
from transformers.utils import logging
|
20 |
logging.set_verbosity_error()
|
21 |
|
|
|
|
|
|
|
|
|
|
|
22 |
od_pipe = pipeline("object-detection", "facebook/detr-resnet-50")
|
23 |
tts_pipe = pipeline("text-to-speech",
|
24 |
model="kakao-enterprise/vits-ljs")
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
demo = gr.Interface(
|
27 |
fn=get_predictions,
|
28 |
inputs=gr.Image(label="Input image",
|