-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to build a yolo pipeline? #1492
Comments
@ritwikdubey Hi, There is no multi-stage prediction.
Yes, multi-stage inference can improve accuracy, if you will crop faces from original not-resized image and recognize each face in separate inference by using neural network that is optimal for face recognition. |
Hello @ritwikdubey, I am also looking into the same problem these days. I have two separate trained YOLO models. One for License Plate Detection from an incoming vehicle, and secondly, the other model for recognizing the license plate from the detected model. I need to build a pipeline, where the output of detected model is fed to the recognized model. If you have any further insight, kindly share with me. Thank you. |
Hello @AlexeyAB, regarding your comment 'implement multi-stage prediction by yourself inside Darknet-code', can you please point me out to that file, where I have to make changes for multi-stage prediction? Thank you. |
@Muhammad057 Line 1083 in 18d5e4f
network net_classifier = parse_network_cfg_custom("cfg/resnet152.cfg", 1);
load_weights(&net_classifier , "resnet152.weights");
for (i = 0; i < nboxes; ++i) {
int class_id = -1;
float prob = 0;
for (j = 0; j < l.classes; ++j) {
if (dets[i].prob[j] > thresh && dets[i].prob[j] > prob) {
prob = dets[i].prob[j];
class_id = j;
}
}
if (class_id >= 0) {
image im_classify = crop_image(im, dets[i].bbox.x, dets[i].bbox.y, dets[i].bbox.w, dets[i].bbox.h);
image r = letterbox_image(im_classify, net_classifier.w, net_classifier.h);
float *predictions_classify = network_predict(net_classifier, r.data);
int top = 1;
top_k(predictions_classify , net_classifier.outputs, top, indexes);
int *indexes = calloc(top, sizeof(int));
for(i = 0; i < top; ++i){
int index = indexes[i];
printf("%s: %f\n",names[index], predictions_classify [index]);
}
}
} |
I believe you meant
BTW, why |
Yes, I fixed it.
No, it doesn't draw boxes. |
@AlexeyAB net_classifier = parse_network_cfg_custom("cfg/yolo-obj.cfg", 1); //yolo_obj is the test cfg file But, what I wanted to do is a little bit different. I run the trained YOLO on a live stream (rtsp link) through this command and I save the frames of a live stream in 'result_img' folder. |
@Muhammad057
I sorta worked on similar problem. I found out that Yolo v3 was quite good in detecting numbers off license plate without character segmentation stage. I guess the way you're thinking is sufficient; 1- localize and segment the license plate region 2- Run prediction on the scaled license plate to detect the numbers. |
@ritwikdubey |
@AlexeyAB , Hi I have a custom classifier (inceptionResNetV2) implemented in python/keras that takes cropped bounding boxes as image inputs. I want to plug that classifier on top of darknet detection. Could you please guide me as to where should I define that model, compile and load the trained weights in this darknet detector code and how do I do it? Thanks for your help! |
what do you mean by scaled? |
@Muhammad057 Are you able to use pipeline in order to combine two stage of plate detection and recognition? I found an article that did license plate recognition by one model not two. Real-Time Brazilian License Plate Detection and Recognition Using Deep Convolutional Neural Networks |
@barzan-hayati Yes I created pipeline to combine both of my models. Anyways thanks for sharing. |
@Muhammad057 Could you please explain your method for pipeline? |
Hi @AlexeyAB ,
Is it possible to build a detection pipeline within darknet? If so, how can I do that?
Say in stage 1 I want to detect all faces in an image and then in stage 2 I want to perform face recognition of a known or unknown person.
Right now I perform face recognition on the whole image but I wonder if I use multistage detection will it improve the accuracy?
The text was updated successfully, but these errors were encountered: