Issue
I would like to duplicate values in yaml file with range 0 to 100. How can I duplicate it?
Solution
import re ,json
labels= []
finduuid = re.findall('images/(.*?).png' , open('old.json', 'r').read())
for x in finduuid:
for i in range(0,101):
labels.append({
"image_path": f"images/{x}_{str(i).zfill(2)}.png",
"label": "",
"aug": True
})
with open('labels.json', 'w') as f:
json.dump(labels, f)
Answered By - Instagram Cr1
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.