./darknet detector test /home/toor/4/darknet/cfg/coco.data /home/toor/4/darknet/cfg/yolov3.cfg /home/toor/4/darknet/yolov3.weights -dont_show < 01.txt > result1.txt
output example:
Total BFLOPS 65.864
seen 64
Enter Image Path: /home/toor/5/darknet/data/pic/2.jpg,
Enter Image Path: /home/toor/5/darknet/data/pic/1.png,person: 98%,
Enter Image Path: /home/toor/5/darknet/data/pic/4.jpg,person: 99%,person: 94%,person: 55%,traffic light:52%
Enter Image Path: /home/toor/5/darknet/data/pic/3.png,person: 100%,person: 100%,person: 100%,person: 46%,
Enter Image Path:
have question:
1.how to caluate person total in pic by change src code?
Enter Image Path: /home/toor/5/darknet/data/pic/3.png,
> total person :4
,person: 100%,person: 100%,person: 100%,person: 46%,
2.how to `comment total BFLOPS ` seen 64 in which src file ?
3.if result no person, how to dont print this line ?
no clue in web.
thanks for any suggestion.
Add here: https://github.com/AlexeyAB/darknet/blob/95773cfb423266b9ac6aeea54e862db5817b5447/src/image.c#L339
printf(" total objects = %d \n", selected_detections_num);
Comment these lines:
Change this line: https://github.com/AlexeyAB/darknet/blob/95773cfb423266b9ac6aeea54e862db5817b5447/src/image.c#L282
to this, where is 0 is a id of person (number of person label in your obj.names file):
if (dets[i].prob[j] > best_class_prob && j == 0) {
works.thanks !
result output is :
_Enter Image Path: /home/toor/5/darknet/data/pic/2.jpg, total object = 0_
Enter Image Path: /home/toor/5/darknet/data/pic/1.png,person: 98%, total object = 1
Enter Image Path: /home/toor/5/darknet/data/pic/4.jpg,person: 99%,person: 94%,person: 55%, total object = 3
Enter Image Path: /home/toor/5/darknet/data/pic/3.png,person: 100%,person: 100%,person: 100%,person: 46%, total object = 4
Enter Image Path:
there is a little issue ,
if total object=0 ,then dont display this line by change the src code?
for example
Enter Image Path: /home/toor/5/darknet/data/pic/1.png,person: 98%, total object = 1
Enter Image Path: /home/toor/5/darknet/data/pic/4.jpg,person: 99%,person: 94%,person: 55%, total object = 3
Enter Image Path: /home/toor/5/darknet/data/pic/3.png,person: 100%,person: 100%,person: 100%,person: 46%, total object = 4
Enter Image Path:
Use
if(selected_detections_num > 0) printf(" total objects = %d \n", selected_detections_num);
instead of
printf(" total objects = %d \n", selected_detections_num);
thanks a lot. @AlexeyAB
please forgive me for my unclear expression. correction as below
if total number =0 , then dont display full line
Enter Image Path: /home/toor/5/darknet/data/pic/2.jpg,
Is possiable change src code to achieve the above effect ?
Considering that this is a new problem, so i reopening new issue(#2113).
@AlexeyAB , Please suggest
Here how can we count :
total number of person
total number of traffic light
??
and display both counts on the predicted image ??
Resolved, thanxs
Most helpful comment
Add here: https://github.com/AlexeyAB/darknet/blob/95773cfb423266b9ac6aeea54e862db5817b5447/src/image.c#L339
printf(" total objects = %d \n", selected_detections_num);Comment these lines:
Change this line: https://github.com/AlexeyAB/darknet/blob/95773cfb423266b9ac6aeea54e862db5817b5447/src/image.c#L282
to this, where is
0is a id of person (number of person label in yourobj.namesfile):if (dets[i].prob[j] > best_class_prob && j == 0) {