I am trying to save the name of objects as image in specific order. Like if there are seven objects detected in image and their names are [chair, tv, bed, chair ,bed, chair, chair]. I want that it should be saved as [chair.png, chair1.png, chair2.png, chair3.png, bed.png, bed1.png, tv.png]
. No matter what objects comes first but its numbers should remains in sequential order respectively. I am trying but is it giving me results like: [bed.png, bed2.png, chair.png, chair1.png, chair3.png, chair4.png, tv.png]
. I guess i have not setted the count variable correctly but I am unable to find it out
My code: