Spaces:
Sleeping
Sleeping
Commit
β’
2349882
1
Parent(s):
6d07f80
Update pages/Captionize.py
Browse files- pages/Captionize.py +4 -2
pages/Captionize.py
CHANGED
@@ -33,8 +33,10 @@ div.stButton > button:hover {
|
|
33 |
|
34 |
pic = st.file_uploader(label="Please upload any Image here π",type=['png', 'jpeg', 'jpg'], help="Only 'png', 'jpeg' or 'jpg' formats allowed")
|
35 |
|
|
|
|
|
36 |
#Image.open(requests.get(pic, stream=True).raw).convert("RGB")
|
37 |
-
loader = ImageCaptionLoader(path_images=
|
38 |
list_docs = loader.load()
|
39 |
index = VectorstoreIndexCreator().from_loaders([loader])
|
40 |
|
@@ -42,7 +44,7 @@ button = st.button("Generate Caption")
|
|
42 |
query = st.text_area("Enter your query π")
|
43 |
|
44 |
if button:
|
45 |
-
Image.open(requests.get(
|
46 |
# Get Response
|
47 |
caption = index.query(query)
|
48 |
st.write(caption)
|
|
|
33 |
|
34 |
pic = st.file_uploader(label="Please upload any Image here π",type=['png', 'jpeg', 'jpg'], help="Only 'png', 'jpeg' or 'jpg' formats allowed")
|
35 |
|
36 |
+
examples = [f"example{i}.jpg" for i in range(1,7)]
|
37 |
+
|
38 |
#Image.open(requests.get(pic, stream=True).raw).convert("RGB")
|
39 |
+
loader = ImageCaptionLoader(path_images=examples)
|
40 |
list_docs = loader.load()
|
41 |
index = VectorstoreIndexCreator().from_loaders([loader])
|
42 |
|
|
|
44 |
query = st.text_area("Enter your query π")
|
45 |
|
46 |
if button:
|
47 |
+
Image.open(requests.get(examples[0], stream=True).raw).convert("RGB")
|
48 |
# Get Response
|
49 |
caption = index.query(query)
|
50 |
st.write(caption)
|