-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Describe the bug
when trying to test the prediction accuracy of a CV model, the given code allows multi image upload, but does not classify the uploaded images. "it will be nice and highly helpful to be able to upload and classify multiple images all at once." this will reduce the stress of accuracy testing and enhance the usability of the model.
To Reproduce
Steps to reproduce the behavior or code you have used
Expected behavior
(1) to be able to upload multiple test images at a time, "from drive and from computer"
(2) to classify all uploaded test images and arrange the classified images in rows and columns.
Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
- OS: Windows
- Browser: Chrome and Edge
- Version: latest
Used Codes
from ipywidgets import FileUpload
from IPython.display import display
btn_upload = FileUpload( multiple=True)
btn_upload
for img_name, img_data in btn_upload.value.items():
print(img_name)
img = PILImage.create(img_data["content"])
display(img)
btn_run = widgets.Button(description='Classify')
btn_run
def on_click_classify(change):
img = PILImage.create(btn_upload.data[-1])
out_pl.clear_output()
with out_pl: display(img.to_thumb(128,128))
pred,pred_idx,probs = learn.predict(img)
lbl_pred.value = f'Prediction: {pred}; Probability: {probs[pred_idx]:.04f}'
btn_run.on_click(on_click_classify)
btn_upload = widgets.FileUpload()
VBox([widgets.Label('Upload stream image!'),
btn_upload, btn_run, out_pl, lbl_pred])