Spaces:
Runtime error
Runtime error
Update UI texts
Browse files- .DS_Store +0 -0
- app.py +6 -8
- audiobot.py +3 -2
- chatbot.py +3 -3
- images/.DS_Store +0 -0
- images/image1.jpeg +0 -0
- images/image10.jpg +0 -0
- images/image11.jpg +0 -0
- images/image2.jpeg +0 -0
- images/image4.jpeg +0 -0
- images/image6.jpg +0 -0
- images/image7.jpg +0 -0
- images/image9.jpg +0 -0
- images/logo.png +0 -0
.DS_Store
ADDED
Binary file (6.15 kB). View file
|
app.py
CHANGED
@@ -13,7 +13,7 @@ def runInThread():
|
|
13 |
|
14 |
def run():
|
15 |
st.set_page_config(
|
16 |
-
page_title='Visual Question Answering - Bot',
|
17 |
page_icon=':robot:',
|
18 |
layout='wide'
|
19 |
)
|
@@ -21,23 +21,21 @@ def run():
|
|
21 |
os.environ['TOKENIZERS_PARALLELISM'] = 'false'
|
22 |
|
23 |
st.sidebar.title('VQA Bot')
|
|
|
24 |
st.sidebar.write('''
|
25 |
VQA Bot addresses the challenge of visual question answering with the chat and voice assistance.
|
26 |
-
Here, we merged Vision
|
27 |
-
We pretrained and finetuned our model on Language
|
28 |
Please use the radio buttons below to navigate.
|
29 |
''')
|
30 |
|
31 |
-
selected_page = st.sidebar.radio('', ('VQA Chatbot', 'VQA Audiobot'))
|
32 |
if selected_page == 'VQA Chatbot':
|
33 |
chatbot.show()
|
34 |
elif selected_page == 'VQA Audiobot':
|
35 |
audiobot.show()
|
36 |
|
37 |
-
st.
|
38 |
-
'Madhuri Sakhare: [Hugging Face](https://huggingface.co/Madhuri)',
|
39 |
-
'[Github](https://github.com/msak1612/vqa_chatbot)'
|
40 |
-
)
|
41 |
|
42 |
if 'thread' not in st.session_state:
|
43 |
st.session_state.thread = threading.Thread(target=runInThread)
|
13 |
|
14 |
def run():
|
15 |
st.set_page_config(
|
16 |
+
page_title='Welcome to Visual Question Answering - Bot',
|
17 |
page_icon=':robot:',
|
18 |
layout='wide'
|
19 |
)
|
21 |
os.environ['TOKENIZERS_PARALLELISM'] = 'false'
|
22 |
|
23 |
st.sidebar.title('VQA Bot')
|
24 |
+
st.sidebar.image('./images/logo.png')
|
25 |
st.sidebar.write('''
|
26 |
VQA Bot addresses the challenge of visual question answering with the chat and voice assistance.
|
27 |
+
Here, we merged ViLT(Vision-and-Language Transformer) model fine-tuned on VQAv2 into T5-small (Text-to-Text Transfer Transformer).
|
28 |
+
We pretrained and finetuned our model on Language transformer to get the desired result.
|
29 |
Please use the radio buttons below to navigate.
|
30 |
''')
|
31 |
|
32 |
+
selected_page = st.sidebar.radio('Go to', ('VQA Chatbot', 'VQA Audiobot'))
|
33 |
if selected_page == 'VQA Chatbot':
|
34 |
chatbot.show()
|
35 |
elif selected_page == 'VQA Audiobot':
|
36 |
audiobot.show()
|
37 |
|
38 |
+
st.caption("Created by Madhuri Sakhare - [Github](https://github.com/msak1612/vqa_chatbot) [Linkedin](https://www.linkedin.com/in/madhuri-sakhare/)")
|
|
|
|
|
|
|
39 |
|
40 |
if 'thread' not in st.session_state:
|
41 |
st.session_state.thread = threading.Thread(target=runInThread)
|
audiobot.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
3 |
from bokeh.models.widgets import Button
|
@@ -9,7 +10,7 @@ import time
|
|
9 |
def show():
|
10 |
st.session_state.audio_answer = ''
|
11 |
|
12 |
-
st.title('Visual Question Answering - Audiobot')
|
13 |
st.markdown('''
|
14 |
<h4 style='text-align: center; color: #B2BEB5;'>
|
15 |
<i>Hi, I am a Visual Audiobot, capable of answering a sequence of questions about images.
|
@@ -29,7 +30,7 @@ def show():
|
|
29 |
st.session_state.image = None
|
30 |
|
31 |
with audio_col:
|
32 |
-
welcome_text='Hello and
|
33 |
welcome_button = Button(label='About Me')
|
34 |
welcome_button.js_on_event('button_click', CustomJS(code=f'''
|
35 |
var u = new SpeechSynthesisUtterance();
|
1 |
+
from turtle import width
|
2 |
import streamlit as st
|
3 |
from PIL import Image
|
4 |
from bokeh.models.widgets import Button
|
10 |
def show():
|
11 |
st.session_state.audio_answer = ''
|
12 |
|
13 |
+
st.title('Welcome to Visual Question Answering - Audiobot')
|
14 |
st.markdown('''
|
15 |
<h4 style='text-align: center; color: #B2BEB5;'>
|
16 |
<i>Hi, I am a Visual Audiobot, capable of answering a sequence of questions about images.
|
30 |
st.session_state.image = None
|
31 |
|
32 |
with audio_col:
|
33 |
+
welcome_text='Hello and Welcome. I have been trained as visual question answering model. You are welcome to look at any image and ask me any questions about it. I will do my best to provide the most accurate information possible based on my expertise. Select an image of interest by pressing the browse files button. Now use the Ask question button to ask a question. Please feel free to ask me any questions about this image. Now. to get my answer. press the Get answer button.'
|
34 |
welcome_button = Button(label='About Me')
|
35 |
welcome_button.js_on_event('button_click', CustomJS(code=f'''
|
36 |
var u = new SpeechSynthesisUtterance();
|
chatbot.py
CHANGED
@@ -35,7 +35,7 @@ def predict(image, input):
|
|
35 |
def show():
|
36 |
init_chat_history()
|
37 |
|
38 |
-
st.title('Visual Question Answering - Chatbot')
|
39 |
st.markdown('''
|
40 |
<h4 style='text-align: center; color: #B2BEB5;'>
|
41 |
<i>Hi, I am a Visual Chatbot, capable of answering a sequence of questions about images.
|
@@ -45,7 +45,7 @@ def show():
|
|
45 |
|
46 |
image_col, text_col = st.columns(2)
|
47 |
with image_col:
|
48 |
-
upload_pic = st.file_uploader('
|
49 |
'jpg', 'png', 'jpeg'], accept_multiple_files=False)
|
50 |
if upload_pic is not None:
|
51 |
image = Image.open(upload_pic)
|
@@ -55,7 +55,7 @@ def show():
|
|
55 |
st.session_state.answer=[]
|
56 |
st.session_state.input = ''
|
57 |
with text_col:
|
58 |
-
input = st.text_input('', '', key='input')
|
59 |
if input:
|
60 |
predict(image, input)
|
61 |
update_chat_messages()
|
35 |
def show():
|
36 |
init_chat_history()
|
37 |
|
38 |
+
st.title('Welcome to Visual Question Answering - Chatbot')
|
39 |
st.markdown('''
|
40 |
<h4 style='text-align: center; color: #B2BEB5;'>
|
41 |
<i>Hi, I am a Visual Chatbot, capable of answering a sequence of questions about images.
|
45 |
|
46 |
image_col, text_col = st.columns(2)
|
47 |
with image_col:
|
48 |
+
upload_pic = st.file_uploader('Select an image...', type=[
|
49 |
'jpg', 'png', 'jpeg'], accept_multiple_files=False)
|
50 |
if upload_pic is not None:
|
51 |
image = Image.open(upload_pic)
|
55 |
st.session_state.answer=[]
|
56 |
st.session_state.input = ''
|
57 |
with text_col:
|
58 |
+
input = st.text_input('Enter question: ', '', key='input')
|
59 |
if input:
|
60 |
predict(image, input)
|
61 |
update_chat_messages()
|
images/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
images/image1.jpeg
ADDED
images/image10.jpg
ADDED
images/image11.jpg
ADDED
images/image2.jpeg
ADDED
images/image4.jpeg
ADDED
images/image6.jpg
ADDED
images/image7.jpg
ADDED
images/image9.jpg
ADDED
images/logo.png
ADDED