andrewsunanda commited on
Commit
2c6d2d6
·
1 Parent(s): 58a6a95

Update eda.py

Browse files
Files changed (1) hide show
  1. eda.py +7 -4
eda.py CHANGED
@@ -7,6 +7,9 @@ import matplotlib.pyplot as plt
7
  import plotly.express as px
8
  from tensorflow.keras.preprocessing.image import ImageDataGenerator
9
  from tensorflow.keras.preprocessing import image
 
 
 
10
 
11
  st.set_page_config(page_title='Fast Food Classification Dataset Analysis', layout='wide', initial_sidebar_state='expanded')
12
 
@@ -27,15 +30,15 @@ def run():
27
 
28
 
29
  st.markdown('---')
30
- main_path= 'D:\\tugas_andrew_DS\\phase_2\\m2\\food'
31
 
32
  # Define batch size and image size
33
  batch_size = 256
34
  img_size = (64, 64)
35
  # Define paths to the data folders
36
- train_path = os.path.join(main_path, 'Train')
37
- valid_path = os.path.join(main_path, 'Valid')
38
- test_path = os.path.join(main_path, 'Test')
39
  # Create data generators for training, validation, and testing
40
  train_datagen = ImageDataGenerator(
41
  rescale=1./255,
 
7
  import plotly.express as px
8
  from tensorflow.keras.preprocessing.image import ImageDataGenerator
9
  from tensorflow.keras.preprocessing import image
10
+ from datasets import load_dataset
11
+ from torchvision import transforms
12
+ from torch.utils.data import DataLoader
13
 
14
  st.set_page_config(page_title='Fast Food Classification Dataset Analysis', layout='wide', initial_sidebar_state='expanded')
15
 
 
30
 
31
 
32
  st.markdown('---')
33
+ dataset = load_dataset('andrewsunanda/fast_food_image_classification')
34
 
35
  # Define batch size and image size
36
  batch_size = 256
37
  img_size = (64, 64)
38
  # Define paths to the data folders
39
+ train_path = dataset['train'].features['filepath']
40
+ valid_path = dataset['validation'].features['filepath']
41
+ test_path = dataset['test'].features['filepath']
42
  # Create data generators for training, validation, and testing
43
  train_datagen = ImageDataGenerator(
44
  rescale=1./255,