You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a subdirectory with all the label txt files, exports a excel file with the counting per label file:
labeldir = 'insert label subdirectory'
names={}
for fn in glob.glob(labeldir + '*.txt'):
with open(fn) as f:
print(f)
names[fn]=sum(1 for line in f if line.strip() and not line.startswith('#'))
with open('yolov5/runs_pool/detect_test/true_det.csv', 'w') as f:
for key in names.keys():
f.write("%s, %s\n" %(key, names[key]))
I have trained a model for detecting bottles, now how to count number of bottles in an image?
The text was updated successfully, but these errors were encountered: