Program will only find 4 of 5 items and then it says I found them all

Hi

I am looking for assistance if possible. I am attempting to do a treasure hunt type game (scavenger hunt) using my model from PIC with a little AI with my students but the list doesn't allow me to find all 5 items. It counts up and marks me as done after the fourth item. I never get to find the wall charger and if I adjust the max items to 6 it gives me an error looking for it and when I try to start at 0 it gives an error as well. Does anyone see the bug in my code?

Keeping a count is a bit complicated for me.

I prefer to make a copy of the list of all items, and remove the last found item from the copy each time.

I know when I'm done when the copied list is empty.

Thanks for this input, what would that code look like?

Try swapping these blocks.

And change the < sign to =<

Thanks for the suggestion I tried both and it didn't work

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.
export_and_upload_aia

Ok, thanks for the handy video. Code added here
TreasureHunt6th_copy.aia (5.3 MB)

This is my first encounter with the Personal Image Classifier, so I am a little fuzzy on what it returns and what your criterion is for a successful match.

Your code assumes the Classifier's returned list of (class, confidence) pairs is sorted in descending order of confidence, with the highest confidence in row 1?

Is being in row 1 enough to distinguish it from the other pairs, or is there a minimum confidence level needed for the match? (I see a dictionary of .925 values free floating at the bottom of your blocks. Is that meant for a minimum?)

Should I be looking for the row with the highest confidence level for the match?

Was the model you trained scrupulous in preserving the case of the class names you use in your blocks? I notice one of them is capitalized, and the others aren't.

This is my first encounter with the Personal Image Classifier, so I am a little fuzzy on what it returns and what your criterion is for a successful match.

Your code assumes the Classifier's returned list of (class, confidence) pairs is sorted in descending order of confidence, with the highest confidence in row 1?
**I didn't adjust the confidence level number I just left them all the same as I wasn't sure if that matters. That code was simply to show the confidence level on the screen. I added this in last but it was happening before. Ive uploaded the same code without the confidence level
TreasureHunt5th_copy.aia (5.5 MB)
**

Was the model you trained scrupulous in preserving the case of the class names you use in your blocks? I notice one of them is capitalized, and the others aren't.
Yes it was, it wouldn't identify the object that was labeled the same as the training model. All others had lowercase (user mistake while creating training classes)

Here's my shot at the app, taking no chances on the ordering of the returned classifications.

I sort them into descending order.
TreasureHunt6th_ABG.aia (5.3 MB)

I dropped the counter, and used a copy of the target class list to deplete as matches occur.

I did not test this.

It seems that your counter starts from 1
It must start from 0, right? Change max items to 6

I tried changing that and it sends the error code that there is no item in the 0 list spot.

I don't said change counter to 0
I said change max items to 6