pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.64k stars 21.33k forks source link

Result from darknet and python darknet not the same probs #745

Open jjehl opened 6 years ago

jjehl commented 6 years ago

Using the python wrapper darknet.py on some specific images, the probs are different from darknet executable. To reproduce car_night_no

On my side, car is 91% using darknet but only 51% using darknet.py. humm.. maybe you don't want to see the truth, here the output : From darknet bin input join image :

103 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
  104 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
  105 conv    255  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 255  0.353 BFLOPs
  106 detection
Loading weights from yolov3.weights...Done!
data/test.jpg: Predicted in 0.277002 seconds.
truck: 56%
car: 91%
from libdarknet.so python wrapped input join image :  
103 conv    128  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 128  0.177 BFLOPs
  104 conv    256  3 x 3 / 1    52 x  52 x 128   ->    52 x  52 x 256  1.595 BFLOPs
  105 conv    255  1 x 1 / 1    52 x  52 x 256   ->    52 x  52 x 255  0.353 BFLOPs
  106 detection
Loading weights from yolov3.weights...Done!
>>> meta = dn.load_meta("cfg/coco.data")
>>> dn.detect(net, meta, "data/test.jpg")
[('truck', 0.562050998210907, (605.8929443359375, 24.99378204345703, 312.0948181152344, 51.71516418457031)), ('car', 0.5101947784423828, (399.1912841796875, 397.6765441894531, 280.55975341796875, 409.4673156738281))]

AH AH ! ====> 51% != 91% What is the right ?

This in only with specific images and only with specific objects. I thinh this is a bug with the python library because other objects on the same image have the same probs. And already tested with different machine, so not my environment in question.

Gilliamwu commented 6 years ago

I have similar issues... I trained my own network with own labeled data. In terminal the result is around 60%, but after using the python wrapper it dropped to 0.3%... I really don't understand why

icicle4 commented 5 years ago

I also meet this problem, from 80% to 0.

muye5 commented 5 years ago

Same problem for COCO_train2014_000000026375.jpg


c version output:

dog: 76%
cat: 100%
cat: 97%
cat: 94%
cat: 89%
cat: 78%
person: 99%

python version output:

[('cat', 0.9965111017227173, (344.1771545410156, 509.37322998046875, 182.52969360351562, 104.0755844116211)), ('person', 0.9897516965866089, (131.70974731445312, 342.12567138671875, 211.811767578125, 368.4753112792969)), ('cat', 0.9686069488525391, (248.71144104003906, 467.8776550292969, 68.30014038085938, 64.51351928710938)), ('cat', 0.9373788237571716, (368.6146240234375, 442.572021484375, 63.95448303222656, 109.6004638671875)), ('cat', 0.8530779480934143, (95.52783966064453, 474.9345703125, 105.72821807861328, 139.1930694580078)), ('cat', 0.7333515286445618, (133.89419555664062, 587.56884765625, 233.74472045898438, 104.83843994140625))]

A strange dog came out in c version result.


By the way, who have reproduced the mAP with yolov3.weights as the official results, please show more details, thanks a lot.

ghost commented 5 years ago

@jjehl I got a similar problem but between pjreddie and alexeyAb version and c++ wrapper version :

https://github.com/AlexeyAB/darknet/issues/2481

@muye5 I had never be able to get same performances as yolov3.weights. Even if with retraining with 12 categories...