osbm commited on
Commit
35b0a89
·
1 Parent(s): 8e8a6df

image from hf

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -121,13 +121,16 @@ if submitted:
121
  st.write("You have voted for all the images")
122
  st.stop()
123
  # https://huggingface.co/datasets/aifred-smart-life-coach/capstone-images/resolve/main/kaggle-human-segmentation-dataset/Women%20I/img/woman_image_200.jpg
124
- print(image_path)
125
- image_url = f"https://huggingface.co/datasets/aifred-smart-life-coach/capstone-images/resolve/main/{image_path}"
126
- # url has whitespace, replace it with %20
127
- image_url = image_url.replace(" ", "%20")
128
- print(image_url)
129
- st.image(image_url, width=300)
130
- st.markdown(f'<img src="{image_url}">', unsafe_allow_html=True)
 
 
 
131
  gender = st.selectbox("Gender", [
132
  "Male",
133
  "Female",
 
121
  st.write("You have voted for all the images")
122
  st.stop()
123
  # https://huggingface.co/datasets/aifred-smart-life-coach/capstone-images/resolve/main/kaggle-human-segmentation-dataset/Women%20I/img/woman_image_200.jpg
124
+ # print(image_path)
125
+ # image_url = f"https://huggingface.co/datasets/aifred-smart-life-coach/capstone-images/resolve/main/{image_path}"
126
+ # # url has whitespace, replace it with %20
127
+ # image_url = image_url.replace(" ", "%20")
128
+ # print(image_url)
129
+ # st.image(image_url, width=300)
130
+ # st.markdown(f'<img src="{image_url}">', unsafe_allow_html=True)
131
+
132
+ path = hfh.hf_hub_download(repo_id="aifred-smart-life-coach/capstone-images", repo_type="dataset",filename=image_path, token=os.environ.get("hf_token"))
133
+ st.image(path, width=300)
134
  gender = st.selectbox("Gender", [
135
  "Male",
136
  "Female",