import io import os import numpy as np import streamlit as st import requests from PIL import Image from model import classify import cv2 @st.cache(allow_output_mutation=True) # def get_model(): # return bone_frac() # pred_model = get_model() # pred_model=bone_frac() def predict(): c=classify('tmp.jpg') st.markdown('#### Predicted Captions:') st.write(c) st.title('Image Captioner') img_url = st.text_input(label='Enter Image URL') if (img_url != "") and (img_url != None): img = Image.open(requests.get(img_url, stream=True).raw) img = img.convert('RGB') st.image(img) img.save('tmp.jpg') predict() os.remove('tmp.jpg') hide_streamlit_style = """ """ st.markdown(hide_streamlit_style, unsafe_allow_html=True) # st.markdown('