Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,10 +6,12 @@ import gradio as gr
|
|
| 6 |
|
| 7 |
from transformers import AutoTokenizer, pipeline, AutoModelForTokenClassification
|
| 8 |
|
| 9 |
-
tokenizer = AutoTokenizer.from_pretrained("Battu007/1_Image_Classification")
|
| 10 |
-
model = AutoModelForTokenClassification.from_pretrained("Battu007/1_Image_Classification")
|
| 11 |
|
|
|
|
| 12 |
|
|
|
|
| 13 |
|
| 14 |
def predict_image(opened_image):
|
| 15 |
img_array = tf.keras.utils.img_to_array(opened_image)
|
|
|
|
| 6 |
|
| 7 |
from transformers import AutoTokenizer, pipeline, AutoModelForTokenClassification
|
| 8 |
|
| 9 |
+
#tokenizer = AutoTokenizer.from_pretrained("Battu007/1_Image_Classification")
|
| 10 |
+
#model = AutoModelForTokenClassification.from_pretrained("Battu007/1_Image_Classification")
|
| 11 |
|
| 12 |
+
class_names = ['daisy', 'dandelion', 'roses', 'sunflowers', 'tulips']
|
| 13 |
|
| 14 |
+
model = tf.keras.models.load_model()
|
| 15 |
|
| 16 |
def predict_image(opened_image):
|
| 17 |
img_array = tf.keras.utils.img_to_array(opened_image)
|