Skip to content

How to make the changes in darknet_images.py work?  #8615

@FalongFan

Description

@FalongFan

I want to get the original coordinates of detected objects. Firstly, I used the command below.

./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/images/test4.png -save_labels -dont_show -ext_output

And I got a .txt file in the same directory with source image in data/images/test4.png named data/images/test4.txt, and it looks like below.
728-2
But I want original coordinates of the objects (the pixel coordinates, before scaled), so I change the source code of writing function called save_annotations and convert2relative in darknet_images.py, showing as below.
728-3
Then, I saved the code file and ran make clean and make -j commands in terminal. After these, I delete data/images/test4.txt and ran the command below again.

./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/images/test4.png -save_labels -dont_show -ext_output

But I got the same result as I changed the code before. How can I make my changes work so that I can get original coordinates of the detected objects?

Appreciate any attempts and answers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions