lqian / light-LPR

Light-LPR is an open source project aimed at license plate recognition that can run on embedded devices, mobile phones, and x86 platforms. It aims to support license plate recognition in various scenarios. The accuracy rate of license plate character recognition exceeds 99.95%, and the comprehensive recognition accuracy rate exceeds 99.%, Support multi-country and multilingual license plate recognition.
776 stars 168 forks source link

No output when run demo #13

Closed AIGirl10 closed 3 years ago

AIGirl10 commented 4 years ago

When trying to run demo on x86, it is building successfully. But when trying to run it, it is not giving any output. The output vector is empty

vector<PlateInfo> plateInfos = detector.recognize(img);
tm.stop();
printf("detect cost: %f (ms)\n", tm.getTimeMilli());
/* Printing vector size */
cout<<"\nsize:"<<plateInfos.size();

it is giving 0 as an output on this image

@lqian can you please check this ? Thank you !

lqian commented 4 years ago

It is missed detection for plate. Maybe the model has changed. or you can try a low threshold for PNet, RNet and ONet.

AIGirl10 commented 4 years ago

@lqian

Thank you so much for fast reply !

  1. Tried to test on another image. This one

and it gave this output.

plateNo: 粤WP9P

what can be the reason ?

  1. When kept 0.4 as threshold for P, R and Onet it is gave me following result on this image
    OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in Mat, file /build/opencv-QiBZO9/opencv-3.2.0/modules/core/src/matrix.cpp, line 522
    terminate called after throwing an instance of 'cv::Exception'
    what():  /build/opencv-QiBZO9/opencv-3.2.0/modules/core/src/matrix.cpp:522: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function Mat

I am using the original demo example given. in with Detect function is commented and calling recognize function.

/*
 * mtcnn_test.cpp
 *
 *  Created on: Jun 25, 2019
 *      Author: lqian
 */

#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>

#include <assert.h>
#include "mlpdr/MLPDR.h"

using namespace std;
using namespace mlpdr;
using namespace cv;
int main(int argc, char ** argv) {
        MLPDR detector(argv[1], 0.4f, 0.4f, 0.4f);
        Mat img = imread(argv[2]);
        assert(!img.empty());
        TickMeter tm;
        tm.start();
//      std::vector<mlpdr::PlateInfo> plateInfos = detector.Detect(img, 40, 3);  // 608.23 ms
        vector<PlateInfo> plateInfos = detector.recognize(img);
        tm.stop();
        printf("detect cost: %f (ms)\n", tm.getTimeMilli());
        cout<<"\nsize:"<<plateInfos.size();
        for (auto pi: plateInfos) {
                cout << "plateNo: " << pi.plateNo << endl;
        }
}

Please let me know if I am doing something wrong. Thank you !

lqian commented 3 years ago

please send picture which can be easy to access.

lqian commented 3 years ago

@AIGirl10 please try community branch code base.

rsingh2083 commented 3 years ago

When trying to run demo on x86, it is building successfully. But when trying to run it, it is not giving any output. The output vector is empty

vector<PlateInfo> plateInfos = detector.recognize(img);
tm.stop();
printf("detect cost: %f (ms)\n", tm.getTimeMilli());
/* Printing vector size */
cout<<"\nsize:"<<plateInfos.size();

it is giving 0 as an output on this image

@lqian can you please check this ? Thank you !

Hi,

I ran this ./examples/demo ../models/ ../images/20201005161220950.jpg , but the only output Im getting is :-

initialized!
done ProposalNet with 60 proposal 
rnet run session and on copy to host
rnet run session and on copy to host
rnet run session and on copy to host
rnet run session and on copy to host
rnet run session and on copy to host
rnet run session and on copy to host
rnet run session and on copy to host
rnet run session and on copy to host
rnet run session and on copy to host
rnet run session and on copy to host
rnet run session and on copy to host
detect cost: 49654.972916 (ms)

Can anyone please help me

lqian commented 3 years ago

please try community branch source code.