pjreddie / darknet

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

How to calculate recall? not only AP or mAP #1967

Open MuhammadAsadJaved opened 4 years ago

MuhammadAsadJaved commented 4 years ago

Hi, I am using ./darknet map for model evaluation but it only return per class precision , TP and FP values, However I also want to know about recall per class. Even i can not calculate it manually because recall = TP / (TP + FN) and this program only return TP and FP. It also print recall collectively but i want to get recall per class. How can I print recall ? Or at least how Can I get FN values? so that I can calculate it manually.

recall1 recall2

amalchaaari commented 4 years ago

hello witch command did you use to get the mAP

MuhammadAsadJaved commented 4 years ago

@amalchaaari
I am using different repo (https://github.com/AlexeyAB/darknet) but you can try this command.

$ ./darknet detector map data/obj.data yolo-obj.cfg backup\yolo-obj_7000.weights

or for this repo maybe

$ ./darknet detector test data/obj.data yolo-obj.cfg backup\yolo-obj_7000.weights

Replace .data , .cfg and .weights with yours.

Adithia99 commented 4 years ago

i use your command but ,machine said need data/test can you show me data/test ? (the format of data/test)

MuhammadAsadJaved commented 4 years ago

@Adithia99 First check how to download and prepare dataset for training and testing. There are a lot of tutorials on Google. you can use public datasets like coco or voc, there are also tutorials how to prepare your own datasets for yolov3 training for custom object detection.

data/obj.data co contains the path of your dataset , change it where you train.txt and val.txt files located.

it looks somthing like this.

classes= 80 train = ./data/voc/train.txt valid = ./data/voc/val.txt names = data/coco.names backup = backup eval=coco

Adithia99 commented 4 years ago

Val.Txt or Data. Test Can you show inside that?

About obj.data mine same with your format.. But still wrong.. I need to see about data/test.txt format (how to make it and like what)

MuhammadAsadJaved commented 4 years ago

it's useless to show mine. it contains thousands images and labels file path for example

/home/computer/data/123.jpg /home/computer/data/123.txt
/home/computer/data/124.jpg /home/computer/data/124.txt
/home/computer/data/125.jpg /home/computer/data/125.txt

these are generated with python shell when you have jpg images and relevent .xml files. , then you will ask how to generate these files. that's why i said first learn from google how to train and test yolov3 on coco or voc dataset.

https://github.com/AlexeyAB/darknet

https://github.com/ultralytics/yolov3

These two darknet repos are well managed , you can also learn from here.

Adithia99 commented 4 years ago

Thanks i can do it

Ashwith-ram commented 3 years ago

Hi @MuhammadAsadJaved Did you find out how to calculate precision and recall for individual classes or at least get FN and FP values?