AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.71k stars 7.96k forks source link

How to export the prediction(boundingbox x,y,w,h, class, e.g) in a txt file? #694

Open dsx0511 opened 6 years ago

dsx0511 commented 6 years ago

Hallo, I have already trained a model for my custom object and it works well. After the Detection I can get a picture with the predicted bounding box named "prediction". Now I have to evaluate this trainded model using some metics by comparison with the ground truth. So what I need are also the exact value of x, y, w, h. My Question is: How can I get these values in a txt-file by modifying some code or using some command? Thanks a lot!

ahsan856jalal commented 6 years ago

https://github.com/pjreddie/darknet/pull/640

Regards Ahsan

On Wed, Apr 25, 2018 at 2:19 PM, Shuxiao Ding notifications@github.com wrote:

Hallo, I have already trained a model for my custom object and it works well. After the Detection I can get a picture with the predicted bounding box named "prediction". Now I have to evaluate this trainded model using some metics by comparison with the ground truth. So what I need are also the exact value of x, y, w, h. My Question is: How can I get these values in a txt-file by modifying some code or using some command? Thanks a lot!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AlexeyAB/darknet/issues/694, or mute the thread https://github.com/notifications/unsubscribe-auth/AK9zjqf53lNFS4MC_8lVpn7IT-QvTXVfks5tsD-EgaJpZM4TjEC8 .

AlexeyAB commented 6 years ago

@dsx0511

Un-comment these 2 lines:

  1. https://github.com/AlexeyAB/darknet/blob/15139eb6abd3c6c05a4046b5ac917de42c678827/src/image.c#L390

  2. https://github.com/AlexeyAB/darknet/blob/15139eb6abd3c6c05a4046b5ac917de42c678827/src/image.c#L246

Re-compile. And run this command:

The result will be in the file result.txt

dsx0511 commented 6 years ago

Thank you for these solutions!

lvshuaigg commented 6 years ago

Excuse me, can you save the predicted picture? For example, I want to predict the picture in the valid, and save the picture after the prediction.