oreo17 commited on
Commit
49c2c83
1 Parent(s): f4cc1f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -1,5 +1,22 @@
1
  import gradio as gr
2
  from transformers import pipeline
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  def predict_image(img):
5
  img_4d=img.reshape(-1,180,180,3)
 
1
  import gradio as gr
2
  from transformers import pipeline
3
+ from transformers import TFBertForSequenceClassification
4
+ import tensorflow as tf
5
+
6
+ data_dir = "C:/Users/Evanslee/Desktop/data"
7
+
8
+ img_height,img_width=180,180
9
+ batch_size=32
10
+ train_ds = tf.keras.preprocessing.image_dataset_from_directory(
11
+ data_dir,
12
+ validation_split=0.2,
13
+ subset="training",
14
+ seed=123,
15
+ image_size=(img_height, img_width),
16
+ batch_size=batch_size)
17
+
18
+ class_names = train_ds.class_names
19
+ print(class_names)
20
 
21
  def predict_image(img):
22
  img_4d=img.reshape(-1,180,180,3)