Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,17 +10,15 @@ configs:
|
|
| 10 |
data_files:
|
| 11 |
- split: test
|
| 12 |
path: products.parquet
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
- config_name: reviews
|
| 15 |
data_files:
|
| 16 |
- split: test
|
| 17 |
path: reviews.parquet
|
| 18 |
-
|
| 19 |
-
dataset_info:
|
| 20 |
-
features:
|
| 21 |
-
- name: image_path
|
| 22 |
-
dtype: image
|
| 23 |
-
|
| 24 |
tags:
|
| 25 |
- tabular
|
| 26 |
---
|
|
@@ -28,28 +26,14 @@ tags:
|
|
| 28 |
Script to download and use the dataset:
|
| 29 |
|
| 30 |
```python
|
| 31 |
-
import os
|
| 32 |
from datasets import load_dataset
|
| 33 |
-
from PIL import Image
|
| 34 |
-
|
| 35 |
-
# 1. Load metadata from Hugging Face
|
| 36 |
-
# This downloads the Parquet file and creates a local cache
|
| 37 |
-
dataset = load_dataset("allietran/CAMEO")
|
| 38 |
-
products = load_dataset("allietran/CAMEO", data_files="products.parquet")
|
| 39 |
-
reviews = load_dataset("allietran/CAMEO", data_files="reviews.parquet")
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
IMAGE_ROOT = "./images"
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
img_path = os.path.join(IMAGE_ROOT, example['relative_path'])
|
| 48 |
-
if os.path.exists(img_path):
|
| 49 |
-
return Image.open(img_path)
|
| 50 |
-
return None
|
| 51 |
|
| 52 |
-
|
| 53 |
-
print(
|
| 54 |
-
print("First review metadata:", reviews['train'][0])
|
| 55 |
```
|
|
|
|
| 10 |
data_files:
|
| 11 |
- split: test
|
| 12 |
path: products.parquet
|
| 13 |
+
features:
|
| 14 |
+
- name: image_path
|
| 15 |
+
dtype: image
|
| 16 |
|
| 17 |
- config_name: reviews
|
| 18 |
data_files:
|
| 19 |
- split: test
|
| 20 |
path: reviews.parquet
|
| 21 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
tags:
|
| 23 |
- tabular
|
| 24 |
---
|
|
|
|
| 26 |
Script to download and use the dataset:
|
| 27 |
|
| 28 |
```python
|
|
|
|
| 29 |
from datasets import load_dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
products = load_dataset("allietran/CAMEO", "products")
|
| 32 |
+
reviews = load_dataset("allietran/CAMEO", "reviews")
|
|
|
|
| 33 |
|
| 34 |
+
print(products["test"][0])
|
| 35 |
+
print(reviews["test"][0])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
+
img = products["test"][0]["image_path"]
|
| 38 |
+
print(type(img))
|
|
|
|
| 39 |
```
|