added setup.py
Browse files
app.py
CHANGED
@@ -1,14 +1,22 @@
|
|
1 |
import streamlit as st
|
2 |
from main import *
|
|
|
3 |
|
4 |
def display(search_request, search_result) :
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
st.header("\"" +search_request+ "\" reminds me of :")
|
7 |
i = 0
|
8 |
for row in range(0, 2):
|
9 |
for col in st.columns(2) :
|
10 |
image_name, comment = search_result[i]
|
11 |
-
col.image("img/"+image_name)
|
12 |
col.header(comment)
|
13 |
i = i + 1
|
14 |
return
|
|
|
1 |
import streamlit as st
|
2 |
from main import *
|
3 |
+
from PIL import Image
|
4 |
|
5 |
def display(search_request, search_result) :
|
6 |
|
7 |
+
|
8 |
+
|
9 |
+
#put your own image here
|
10 |
+
lorax = Image.open('img/Lorax.jpg')
|
11 |
+
print(lorax.width, lorax.height)
|
12 |
+
st.image(lorax, width = 250)
|
13 |
+
|
14 |
st.header("\"" +search_request+ "\" reminds me of :")
|
15 |
i = 0
|
16 |
for row in range(0, 2):
|
17 |
for col in st.columns(2) :
|
18 |
image_name, comment = search_result[i]
|
19 |
+
col.image("img/"+image_name, width = 300)
|
20 |
col.header(comment)
|
21 |
i = i + 1
|
22 |
return
|
setup.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import hf_hub_url, cached_download
|
2 |
+
from huggingface_hub.archive import unpack_archive
|
3 |
+
|
4 |
+
|
5 |
+
# Specify the Google Drive link to the archive file
|
6 |
+
archive_url = 'https://drive.google.com/uc?id=14QhofCbby053kWbVeWEBHCxOROQS-bjN'
|
7 |
+
|
8 |
+
# Specify the destination directory within the Hugging Face space
|
9 |
+
destination_dir = 'osanchik/flickr'
|
10 |
+
|
11 |
+
|
12 |
+
# Replace with your desired destination directory
|
13 |
+
|
14 |
+
# Construct the destination path
|
15 |
+
destination_path = hf_hub_url(destination_dir)
|
16 |
+
# Download the archive to the destination path
|
17 |
+
cached_download(archive_url, destination_path)
|
18 |
+
# Unpack the archive
|
19 |
+
unpack_archive(destination_path, destination_dir)
|
20 |
+
print(f"Archive unpacked to: {destination_dir}")
|