Neutralizing Url feature for now.
Browse files
main.py
CHANGED
|
@@ -10,7 +10,7 @@ def main():
|
|
| 10 |
topic_generator = TopicGenerator()
|
| 11 |
img_caption = ImageCaptioning()
|
| 12 |
|
| 13 |
-
user_input = st.selectbox(label="Text Input or Image Input", options=["Text", "Image"
|
| 14 |
|
| 15 |
if user_input == "Text":
|
| 16 |
text_input = st.text_input(label="Put in your Idea, Let's generate a matching Topic Sentence🤗🤗")
|
|
@@ -30,15 +30,15 @@ def main():
|
|
| 30 |
for idx, topic in enumerate(generated_topics, 1):
|
| 31 |
st.write(f"Topic {idx}: {topic}")
|
| 32 |
|
| 33 |
-
elif user_input == "Image URL":
|
| 34 |
-
url_input = st.text_input(label="Do you have a link to the Image you would like to drop, Go Ahead and We got you covered😉😉")
|
| 35 |
-
if url_input:
|
| 36 |
-
img_load = load_image(check_url(url_input))
|
| 37 |
-
caption = img_caption.get_caption(img_load)
|
| 38 |
-
st.image(image=img_load, caption=caption, width=250)
|
| 39 |
-
generated_topics = topic_generator.generate_topics(caption)
|
| 40 |
-
for idx, topic in enumerate(generated_topics, 1):
|
| 41 |
-
st.write(f"Topic {idx}: {topic}")
|
| 42 |
|
| 43 |
if __name__ == "__main__":
|
| 44 |
main()
|
|
|
|
| 10 |
topic_generator = TopicGenerator()
|
| 11 |
img_caption = ImageCaptioning()
|
| 12 |
|
| 13 |
+
user_input = st.selectbox(label="Text Input or Image Input", options=["Text", "Image"])
|
| 14 |
|
| 15 |
if user_input == "Text":
|
| 16 |
text_input = st.text_input(label="Put in your Idea, Let's generate a matching Topic Sentence🤗🤗")
|
|
|
|
| 30 |
for idx, topic in enumerate(generated_topics, 1):
|
| 31 |
st.write(f"Topic {idx}: {topic}")
|
| 32 |
|
| 33 |
+
# elif user_input == "Image URL":
|
| 34 |
+
# url_input = st.text_input(label="Do you have a link to the Image you would like to drop, Go Ahead and We got you covered😉😉")
|
| 35 |
+
# if url_input:
|
| 36 |
+
# img_load = load_image(check_url(url_input))
|
| 37 |
+
# caption = img_caption.get_caption(img_load)
|
| 38 |
+
# st.image(image=img_load, caption=caption, width=250)
|
| 39 |
+
# generated_topics = topic_generator.generate_topics(caption)
|
| 40 |
+
# for idx, topic in enumerate(generated_topics, 1):
|
| 41 |
+
# st.write(f"Topic {idx}: {topic}")
|
| 42 |
|
| 43 |
if __name__ == "__main__":
|
| 44 |
main()
|