Skip to content

Logging Object Detection Results of Video in the Excel File #2133

Answered by glenn-jocher
Aar-Kay asked this question in Q&A
Discussion options

You must be logged in to vote

@Aar-Kay hey buddy, congrats on your first training! You can produce detection logs as text files from video frames like this:

python detect.py --source video.mp4 --save-txt

The part of detect.py that saves these text files is here, you could introduce your own code to update an excel file instead:

yolov5/detect.py

Lines 103 to 110 in 73a0669

# Write results
for *xyxy, conf, cls in reversed(det):
if save_txt: # Write to file
xywh = (xyxy2xywh(torch.tensor(xyxy).view(1, 4)) / gn).view(-1).tolist() # normalized xywh
line = (cls, *xywh, conf) if opt.save_conf else (cls, *xywh) # label format
with open(txt_path + '.txt', 'a') as f:
f.write(('%g ' * len(

Replies: 5 comments 19 replies

Comment options

You must be logged in to vote
8 replies
@mintu07ruet
Comment options

@mintu07ruet
Comment options

@mintu07ruet
Comment options

@renjirow
Comment options

@Asphyxcome
Comment options

Answer selected by Aar-Kay
Comment options

You must be logged in to vote
5 replies
@glenn-jocher
Comment options

@glenn-jocher
Comment options

@mintu07ruet
Comment options

@glenn-jocher
Comment options

@parmarth-1208
Comment options

Comment options

You must be logged in to vote
4 replies
@glenn-jocher
Comment options

@glenn-jocher
Comment options

@mintu07ruet
Comment options

@glenn-jocher
Comment options

Comment options

You must be logged in to vote
2 replies
@saktheeswaranswan
Comment options

@saktheeswaranswan
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
8 participants