File size: 535 Bytes
9434e34
7f8233b
0ad39d9
9434e34
 
7f8233b
 
0ad39d9
7f8233b
0ad39d9
 
 
 
7f8233b
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import streamlit as st
from datasets import load_dataset, Image
from huggingface_hub import from_pretrained_keras

x = st.slider('Select a value')
st.write(x, 'squared is', x * x)

#loaded_model = keras.saving.load_model("best_model.keras")

model = from_pretrained_keras("best_model.keras")
prediction = model.predict(image)
prediction = tf.squeeze(tf.round(prediction))
print(f'The image is a {classes[(np.argmax(prediction))]}!')


dataset = load_dataset("beans", split="train")

loaded_img = dataset[0]["image"]
print(loaded_img)