Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,26 +7,16 @@ from model import bone_frac
|
|
7 |
|
8 |
|
9 |
@st.cache(allow_output_mutation=True)
|
10 |
-
|
11 |
-
|
12 |
|
13 |
-
|
14 |
# pred_model=bone_frac()
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
# st.markdown('#### Predicted Captions:')
|
21 |
-
# captions.append(pred_caption)
|
22 |
-
|
23 |
-
# for _ in range(4):
|
24 |
-
# pred_caption = generate_caption('tmp.jpg', caption_model, add_noise=True)
|
25 |
-
# if pred_caption not in captions:
|
26 |
-
# captions.append(pred_caption)
|
27 |
-
|
28 |
-
# for c in captions:
|
29 |
-
# st.write(c)
|
30 |
|
31 |
st.title('Image Captioner')
|
32 |
img_url = st.text_input(label='Enter Image URL')
|
|
|
7 |
|
8 |
|
9 |
@st.cache(allow_output_mutation=True)
|
10 |
+
def get_model():
|
11 |
+
return get_caption_model()
|
12 |
|
13 |
+
pred_model = get_model()
|
14 |
# pred_model=bone_frac()
|
15 |
|
16 |
+
def predict():
|
17 |
+
c=pred_model('tmp.jpg')
|
18 |
+
st.markdown('#### Predicted Captions:')
|
19 |
+
st.write(c)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
st.title('Image Captioner')
|
22 |
img_url = st.text_input(label='Enter Image URL')
|