Nuno-Tome commited on
Commit
396ae71
1 Parent(s): 545ab80

no message

Browse files
Files changed (1) hide show
  1. app.py +7 -6
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
- image_object = dataset['pasta'][0]
 
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("Nunt/testedata","testedata_readme")
61
- classifier = pipeline('image-classification', model=model_name, device=0)
 
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