Spaces:
Sleeping
Sleeping
traopia commited on
Commit ·
69fe46f
1
Parent(s): 6eb7b41
ask fashiondb
Browse files
app.py
CHANGED
|
@@ -31,11 +31,11 @@ from io import BytesIO
|
|
| 31 |
#@st.cache_data(show_spinner="Loading FashionDB...")
|
| 32 |
def load_data_hf():
|
| 33 |
# Load the Parquet file directly from Hugging Face
|
| 34 |
-
df_url = "https://huggingface.co/datasets/traopia/
|
| 35 |
df = pd.read_parquet(df_url)
|
| 36 |
|
| 37 |
# Load the .npy file using requests
|
| 38 |
-
npy_url = "https://huggingface.co/datasets/traopia/
|
| 39 |
response = requests.get(npy_url)
|
| 40 |
response.raise_for_status() # Raise error if download fails
|
| 41 |
embeddings = np.load(BytesIO(response.content))
|
|
@@ -256,6 +256,14 @@ with gr.Blocks() as demo:
|
|
| 256 |
outputs=[uploaded_similar_gallery, uploaded_similar_metadata_output, uploaded_reference_image]
|
| 257 |
)
|
| 258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
back_button = gr.Button("Back to Home")
|
| 260 |
|
| 261 |
def back_to_home():
|
|
|
|
| 31 |
#@st.cache_data(show_spinner="Loading FashionDB...")
|
| 32 |
def load_data_hf():
|
| 33 |
# Load the Parquet file directly from Hugging Face
|
| 34 |
+
df_url = "https://huggingface.co/datasets/traopia/vogue-runway/resolve/main/VogueRunway.parquet"
|
| 35 |
df = pd.read_parquet(df_url)
|
| 36 |
|
| 37 |
# Load the .npy file using requests
|
| 38 |
+
npy_url = "https://huggingface.co/datasets/traopia/vogue-runway/resolve/main/VogueRunway_image.npy"
|
| 39 |
response = requests.get(npy_url)
|
| 40 |
response.raise_for_status() # Raise error if download fails
|
| 41 |
embeddings = np.load(BytesIO(response.content))
|
|
|
|
| 256 |
outputs=[uploaded_similar_gallery, uploaded_similar_metadata_output, uploaded_reference_image]
|
| 257 |
)
|
| 258 |
|
| 259 |
+
with gr.Tab("Query on FashionDB"):
|
| 260 |
+
with gr.Row():
|
| 261 |
+
gr.Markdown(
|
| 262 |
+
"### 🔗 Query FashionDB SPARQL Endpoint\n"
|
| 263 |
+
"[Click here to open the SPARQL endpoint](https://fashionwiki.wikibase.cloud/query/)",
|
| 264 |
+
elem_id="sparql-link"
|
| 265 |
+
)
|
| 266 |
+
|
| 267 |
back_button = gr.Button("Back to Home")
|
| 268 |
|
| 269 |
def back_to_home():
|