weiliu89 / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
4.77k stars 1.67k forks source link

About the AP of each class #722

Open whuhxb opened 7 years ago

whuhxb commented 7 years ago

Please use the caffe-users list for usage, installation, or modeling questions, or other requests for help. Do not post such requests to Issues. Doing so interferes with the development of Caffe.

Please read the guidelines for contributing before submitting this issue.

Issue summary

Steps to reproduce

If you are having difficulty building Caffe or training a model, please ask the caffe-users mailing list. If you are reporting a build error that seems to be due to a bug in Caffe, please attach your build configuration (either Makefile.config or CMakeCache.txt) and the output of the make (or cmake) command.

Your system configuration

Operating system: Compiler: CUDA version (if applicable): CUDNN version (if applicable): BLAS: Python or MATLAB version (for pycaffe and matcaffe respectively):

I have tried the newest SSD code with my own dataset (examined with the AP calculation codes in bbox_util.cpp), but the outputs of the experiment only have the mAP (namely detection_val value) without the AP value of each class. Anybody has this problem? How to solve this problem? Thank you very much.

weiliu89 commented 7 years ago

You could print per label AP at here. But in general, you should use the official devkit from the particular dataset you are evaluating. The AP (mAP) computed in the ssd branch only provides a reference point during training time, although it should be similar to the official one.

whuhxb commented 7 years ago

@weiliu89 Yeah. I have seen these codes in my SSD version, and the previous work is done with these codes. But the results I obtained do not contain the AP values. Should I revised/add code in /examples/ssd/ssd_pascal.py?

Below are the corresponding codes from Solver.cpp: const vector<pair<float, int> >& label_false_pos = false_pos.find(label)->second; vector prec, rec; ComputeAP(label_true_pos, label_num_pos, label_falsepos, param.apversion(), &prec, &rec, &(APs[label])); mAP += APs[label]; if (param.show_per_class_result()) { LOG(INFO) << "class" << label << ": " << APs[label]; } } mAP /= num_pos.size(); const int output_blob_index = test_net->output_blob_indices()[i]; const string& output_name = test_net->blob_names()[output_blob_index]; LOG(INFO) << " Test net output #" << i << ": " << output_name << " = " << mAP; }

weiliu89 commented 7 years ago

You should set show_per_class_result to True in the solver_param.

whuhxb commented 7 years ago

Ok. I have solved this problem. Thank you very much.

在 2017-08-26 00:11:00,"Wei Liu" notifications@github.com 写道:

You should set show_per_class_result to True in the solver_param.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Xueyan0920 commented 6 years ago

Thank you!