Spaces:
Sleeping
Sleeping
no message
Browse files
app.py
CHANGED
@@ -39,26 +39,27 @@ def main():
|
|
39 |
'''
|
40 |
Model
|
41 |
'''
|
42 |
-
shosen_model_name = st.selectbox("Select the model to use", MODELS)
|
43 |
if shosen_model_name is not None:
|
44 |
st.write("You selected", shosen_model_name)
|
45 |
|
46 |
'''
|
47 |
Dataset
|
48 |
'''
|
49 |
-
shosen_dataset_name = st.radio("Select the model to use", DATASETS)
|
50 |
if shosen_dataset_name is not None:
|
51 |
st.write("You selected", shosen_dataset_name)
|
52 |
-
|
|
|
53 |
|
54 |
'''
|
55 |
click to classify
|
56 |
'''
|
57 |
if shosen_model_name is not None and shosen_dataset_name is not None:
|
58 |
-
st.image(shosen_dataset[0], caption="Uploaded Image", use_column_width=True)
|
59 |
if st.button("Classify images"):
|
60 |
-
dataset = load_dataset(
|
61 |
-
|
|
|
62 |
classify_images(classifier, dataset)
|
63 |
|
64 |
|
|
|
39 |
'''
|
40 |
Model
|
41 |
'''
|
42 |
+
shosen_model_name = st.selectbox("Select the model to use", MODELS, index=0)
|
43 |
if shosen_model_name is not None:
|
44 |
st.write("You selected", shosen_model_name)
|
45 |
|
46 |
'''
|
47 |
Dataset
|
48 |
'''
|
49 |
+
shosen_dataset_name = st.radio("Select the model to use", DATASETS index=0)
|
50 |
if shosen_dataset_name is not None:
|
51 |
st.write("You selected", shosen_dataset_name)
|
52 |
+
|
53 |
+
#image_object = dataset['pasta'][0]
|
54 |
|
55 |
'''
|
56 |
click to classify
|
57 |
'''
|
58 |
if shosen_model_name is not None and shosen_dataset_name is not None:
|
|
|
59 |
if st.button("Classify images"):
|
60 |
+
dataset = load_dataset(shosen_dataset_name,"testedata_readme")
|
61 |
+
st.image(dataset[0], caption="Uploaded Image", use_column_width=True)
|
62 |
+
classifier = pipeline('image-classification', model=shosen_model_name, device=0)
|
63 |
classify_images(classifier, dataset)
|
64 |
|
65 |
|