Nuno-Tome commited on
Commit
1917584
·
1 Parent(s): 516765a

no message

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -29,7 +29,8 @@ def classify_images(classifier_model, dataset_to_classify):
29
  '''
30
  return "done"
31
 
32
-
 
33
 
34
  def main():
35
  st.title("Bulk Image Classification")
@@ -59,24 +60,29 @@ def main():
59
  '''
60
  if shosen_model_name is not None and shosen_dataset_name is not None:
61
  if st.button("Classify images"):
 
 
62
  st.write("# FLAG 1")
63
 
64
  dataset = load_dataset(shosen_dataset_name,"testedata_readme")
65
  st.write("# FLAG 2")
66
 
67
- #image_object = dataset['pasta'][0]
68
- #image_object = dataset['pasta'][0]["image"]
69
- #st.image(image_object, caption="Uploaded Image", use_column_width=True)
70
- #st.image(dataset[0], caption="Uploaded Image", use_column_width=True)
71
  image_object = dataset['pasta'][0]["image"]
72
  st.image(image_object, caption="Uploaded Image", use_column_width=True)
73
  st.write("# FLAG 3")
74
 
75
- classifier = pipeline('image-classification', model=shosen_model_name, device=0)
 
76
  st.write("# FLAG 4")
77
-
78
-
79
 
 
 
 
 
 
 
 
80
 
81
 
82
  if __name__ == "__main__":
 
29
  '''
30
  return "done"
31
 
32
+ def classify(image, classifier_pipeline):
33
+ return "done"
34
 
35
  def main():
36
  st.title("Bulk Image Classification")
 
60
  '''
61
  if shosen_model_name is not None and shosen_dataset_name is not None:
62
  if st.button("Classify images"):
63
+
64
+ classification_obj1 =[]
65
  st.write("# FLAG 1")
66
 
67
  dataset = load_dataset(shosen_dataset_name,"testedata_readme")
68
  st.write("# FLAG 2")
69
 
70
+ #Igame
 
 
 
71
  image_object = dataset['pasta'][0]["image"]
72
  st.image(image_object, caption="Uploaded Image", use_column_width=True)
73
  st.write("# FLAG 3")
74
 
75
+ #modle instance
76
+ classifier_pipeline = pipeline('image-classification', model=shosen_model_name, device=0)
77
  st.write("# FLAG 4")
 
 
78
 
79
+ #classification
80
+ classification_result = classify(image_object, classifier_pipeline)
81
+ st.write(classification_result)
82
+ st.write("# FLAG 5")
83
+ classification_obj1.append(classification_result)
84
+ st.write("# FLAG 6")
85
+ st.write(classification_obj1)
86
 
87
 
88
  if __name__ == "__main__":