Working on fixed file upload issue
Browse files
app.py
CHANGED
@@ -53,36 +53,8 @@ def main():
|
|
53 |
st.caption("Accurate and enchanting descriptions of clothes on shopping websites can help customers without fashion knowledge to better understand the features (attributes, style, functionality, etc.) of the items and increase online sales by enticing more customers.")
|
54 |
st.caption("Also, most of the time when any customer visits shopping websites, they are looking for a certain style or type of clothes that wish to purchase, they search for the item by providing a description of the item and the system finds the relevant items that match the search query by computing the similarity score between the query and the item caption.")
|
55 |
st.caption("Given the clothes image provide a short caption that describes the item. In general, in image captioning datasets (e.g., COCO, Fliker), the descriptions of fashion items have three unique features, which makes the automatic generation of captions a challenging task. First, fashion captioning needs to describe the attributes of an item, while image captioning generally narrates the objects and their relations in the image.")
|
56 |
-
st.caption("Solution: Used Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models [(BLIP-2)](https://huggingface.co/Salesforce/blip2-opt-
|
57 |
-
st.write("For more detail: [Github link](https://github.com/SmithaUpadhyaya/fashion_image_caption)")
|
58 |
-
footer = """<style>
|
59 |
-
a:link , a:visited{
|
60 |
-
color: blue;
|
61 |
-
background-color: transparent;
|
62 |
-
text-decoration: underline;
|
63 |
-
}
|
64 |
-
|
65 |
-
a:hover, a:active {
|
66 |
-
color: red;
|
67 |
-
background-color: transparent;
|
68 |
-
text-decoration: underline;
|
69 |
-
}
|
70 |
-
|
71 |
-
.footer {
|
72 |
-
position: fixed;
|
73 |
-
left: 0;
|
74 |
-
bottom: 0;
|
75 |
-
width: 100%;
|
76 |
-
background-color: white;
|
77 |
-
color: black;
|
78 |
-
text-align: center;
|
79 |
-
}
|
80 |
-
</style>
|
81 |
-
<div class="footer">
|
82 |
-
<p>Application deployed on CPU with 16GB RAM</p>
|
83 |
-
</div>
|
84 |
-
"""
|
85 |
-
st.markdown(footer,unsafe_allow_html=True)
|
86 |
|
87 |
processor, model = init_model()
|
88 |
|
@@ -95,7 +67,7 @@ def main():
|
|
95 |
btn_click = st.button('Generate')
|
96 |
|
97 |
if btn_click:
|
98 |
-
|
99 |
image = None
|
100 |
if file_name is not None:
|
101 |
|
@@ -131,6 +103,7 @@ def main():
|
|
131 |
caption_text.header("Generated Caption")
|
132 |
caption_text.text(generated_caption)
|
133 |
|
|
|
134 |
|
135 |
if __name__ == "__main__":
|
136 |
main()
|
|
|
53 |
st.caption("Accurate and enchanting descriptions of clothes on shopping websites can help customers without fashion knowledge to better understand the features (attributes, style, functionality, etc.) of the items and increase online sales by enticing more customers.")
|
54 |
st.caption("Also, most of the time when any customer visits shopping websites, they are looking for a certain style or type of clothes that wish to purchase, they search for the item by providing a description of the item and the system finds the relevant items that match the search query by computing the similarity score between the query and the item caption.")
|
55 |
st.caption("Given the clothes image provide a short caption that describes the item. In general, in image captioning datasets (e.g., COCO, Fliker), the descriptions of fashion items have three unique features, which makes the automatic generation of captions a challenging task. First, fashion captioning needs to describe the attributes of an item, while image captioning generally narrates the objects and their relations in the image.")
|
56 |
+
st.caption("Solution: Used Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models [(BLIP-2)](https://huggingface.co/Salesforce/blip2-opt-2.7b) by Salesforce")
|
57 |
+
st.write("For more detail: [Github link](https://github.com/SmithaUpadhyaya/fashion_image_caption)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
processor, model = init_model()
|
60 |
|
|
|
67 |
btn_click = st.button('Generate')
|
68 |
|
69 |
if btn_click:
|
70 |
+
|
71 |
image = None
|
72 |
if file_name is not None:
|
73 |
|
|
|
103 |
caption_text.header("Generated Caption")
|
104 |
caption_text.text(generated_caption)
|
105 |
|
106 |
+
st.write("Application deployed on CPU basic with 16GB RAM")
|
107 |
|
108 |
if __name__ == "__main__":
|
109 |
main()
|