Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,17 +24,16 @@ def predict(image):
|
|
24 |
|
25 |
sentiment_string = ''.join(str(e) for e in sentiment)
|
26 |
|
27 |
-
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
32 |
|
33 |
-
output =
|
34 |
return output
|
35 |
|
36 |
|
37 |
-
|
38 |
input = gr.inputs.Image(
|
39 |
label="Upload your Image and wait for 8-12 seconds!", type='pil', optional=False)
|
40 |
output = gr.outputs.Textbox(label="Captions")
|
|
|
24 |
|
25 |
sentiment_string = ''.join(str(e) for e in sentiment)
|
26 |
|
27 |
+
image_caption = caption_string[21:-3]
|
28 |
|
29 |
+
percentage =sentiment_string[34: -14]
|
30 |
|
31 |
+
tone = sentiment_string[11:-31]
|
32 |
|
33 |
+
output = 'the image is of, ' + image_caption + ", the overall tone of the image's content is - "+ tone + " with a approx "+ percentage + "% score"
|
34 |
return output
|
35 |
|
36 |
|
|
|
37 |
input = gr.inputs.Image(
|
38 |
label="Upload your Image and wait for 8-12 seconds!", type='pil', optional=False)
|
39 |
output = gr.outputs.Textbox(label="Captions")
|