I want to store each detection value and combine it into an array to save it to excel. I want to apped sa_mask to add all detection values to save_mask variable, but I tried apped and got only the last detected value. It doesn't store all values. enter image description here
if FLAGS.count:
# count objects found
counted_classes = count_objects(pred_bbox, by_class = True)
# loop through dict and print
sa_counted = np.array(counted_classes)
print(sa_counted)
for key, value in counted_classes.items():
print("Number of {}s: {}".format(key, value))
sa_mask = ("{} {}".format(key, value))
save_mask = []
save_mask.apped(sa_mask)
You're simply not storing the values and adding them together, so each time the loop is entered, it just keeps overwriting the previous results...
I'll try simplifying this as much as possible :
I hope this was helpful.