@@ -26,14 +26,17 @@ def download_image(image_url, save_path):
26
26
return False
27
27
28
28
# Download the dataset from Hugging Face
29
- dataset = load_dataset ('DBQ/Burberry.Product.prices.United.States' )
30
- # Examples. dataset = load_dataset('DBQ/Burberry.Product.prices.United.States')
29
+ # Simply replace DataSet with the Hugging Face DataSet name
30
+ # Example. dataset = load_dataset('DBQ/Burberry.Product.prices.United.States')
31
+ dataset = load_dataset ('DataSet' )
31
32
32
33
# Convert the Hugging Face dataset to a Pandas DataFrame
33
34
df = dataset ['train' ].to_pandas ()
34
35
35
- # Create directories to save the dataset and images
36
- dataset_dir = './data/burberry_dataset'
36
+ # Create directories to save the dataset and images to a folder
37
+ # Example. dataset_dir = './data/burberry_dataset'
38
+ dataset_dir = './data/Dataset'
39
+
37
40
images_dir = os .path .join (dataset_dir , 'images' )
38
41
os .makedirs (images_dir , exist_ok = True )
39
42
@@ -50,8 +53,11 @@ def download_image(image_url, save_path):
50
53
# Create a new DataFrame with the filtered rows
51
54
filtered_df = pd .DataFrame (filtered_rows )
52
55
53
- # Save the updated dataset to disk
54
- dataset_path = os .path .join (dataset_dir , 'burberry_dataset.csv' )
56
+ # Save the updated dataset to disk in a CSV format
57
+ # Example. dataset_path = os.path.join(dataset_dir, 'burberry_dataset.csv')
58
+ # dataset_path = os.path.join(dataset_dir, 'burberry_dataset.csv')
59
+ dataset_path = os .path .join (dataset_dir , 'Dataset.csv' )
60
+
55
61
filtered_df .to_csv (dataset_path , index = False )
56
62
57
63
print (f"Dataset and images saved to { dataset_dir } " )
0 commit comments