twhite2219 / selfdrivingcarV1

0 stars 0 forks source link

images #1

Closed berak closed 7 years ago

berak commented 7 years ago

https://github.com/twhite2219/selfdrivingcarV1/blob/master/train_data/0/i%20%2837%29.jpg

is this really a"go left" situation ? no idea, what you're doing with your car later, but assuming, there's a single camera pointing forward, maybe use images from that perspective ?

probably, restricting it to 3 cases like:

  |   |
  |   |            (forward)

     _____
   /     ___ 
  /    /
 |     |             (right)

   ____
 ____    \
      \     |          (left)
       |     |

will give much better results. (bare with my poor ascii graphics ;)

twhite2219 commented 7 years ago

HI- yes I did consider that however it has to stay in between the lines, and the entire curve being recognised would mean it would try to follow it as one which is complicated with such crap motors, you have to assume the vehicle goes in a straight line unless the line ahead of it is past a 45 degree angle left or right in which case it would correct itself. I cannot figure out why none of the NN VALUES are correct and why it gives a score of 0... could it be the modloc?

Get Outlook for iOShttps://aka.ms/o0ukef


From: berak notifications@github.com Sent: Tuesday, March 7, 2017 9:29:19 AM To: twhite2219/selfdrivingcarV1 Cc: Subscribed Subject: [twhite2219/selfdrivingcarV1] images (#1)

https://github.com/twhite2219/selfdrivingcarV1/blob/master/train_data/0/i%20%2837%29.jpg

is this really a"go left" situation ? no idea, what you're doing with your car later, but assuming, there's a single camera pointing forward, maybe use images from that perspective ?

probably, restricting it to 3 cases like:

| | | | (forward)

 _____

/ ___ / / | | (right)


____ \ \ (left)

will give much better results. (bare with my poor ascii graphics ;)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/twhite2219/selfdrivingcarV1/issues/1, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQlGslsHJ4XTMLc1GQEM261MwweHCLMpks5rjSNvgaJpZM4MVPBw.

twhite2219 commented 7 years ago

See attached, car will go straight and alter course accordingly in real time to stay between two lines... [Image]

Get Outlook for iOShttps://aka.ms/o0ukef


From: Toby White twhite_96@live.co.uk Sent: Tuesday, March 7, 2017 9:33:05 AM To: twhite2219/selfdrivingcarV1 Subject: Re: [twhite2219/selfdrivingcarV1] images (#1)

HI- yes I did consider that however it has to stay in between the lines, and the entire curve being recognised would mean it would try to follow it as one which is complicated with such crap motors, you have to assume the vehicle goes in a straight line unless the line ahead of it is past a 45 degree angle left or right in which case it would correct itself. I cannot figure out why none of the NN VALUES are correct and why it gives a score of 0... could it be the modloc?

Get Outlook for iOShttps://aka.ms/o0ukef


From: berak notifications@github.com Sent: Tuesday, March 7, 2017 9:29:19 AM To: twhite2219/selfdrivingcarV1 Cc: Subscribed Subject: [twhite2219/selfdrivingcarV1] images (#1)

https://github.com/twhite2219/selfdrivingcarV1/blob/master/train_data/0/i%20%2837%29.jpg

is this really a"go left" situation ? no idea, what you're doing with your car later, but assuming, there's a single camera pointing forward, maybe use images from that perspective ?

probably, restricting it to 3 cases like:

| | | | (forward)

 _____

/ ___ / / | | (right)


____ \ \ (left)

will give much better results. (bare with my poor ascii graphics ;)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/twhite2219/selfdrivingcarV1/issues/1, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQlGslsHJ4XTMLc1GQEM261MwweHCLMpks5rjSNvgaJpZM4MVPBw.

berak commented 7 years ago

what's modloc ?

(and no i do not want outlook for ios ;)

twhite2219 commented 7 years ago

Modloc Is the part that calculates the highest recieved probablilty from the NN and its location (0,1 or 2) or so i believe.

I think the NN has no reason as to why it doesnt work apart from something related to my setters... the number of iterations/backprop ratio maybe/ layer sizes ... maybe one of those is incorrect?

other than that the only thing I feel it could be is this :

for(int i=0; i<train_classes.rows; i++) { train_classes.at(i, train_labels.at(i)) = 1.f; } cerr << train_data.size() << " " << train_classes.size() << endl;

ann->train(train_data, ml::ROW_SAMPLE, train_classes);

purely because i do not understand it.

One of the 4 mentioned issues must be the reason it is not working.... do you agree? if so how should it be?


From: berak notifications@github.com Sent: 07 March 2017 09:36 To: twhite2219/selfdrivingcarV1 Cc: Toby White; Comment Subject: Re: [twhite2219/selfdrivingcarV1] images (#1)

what's modloc ?

(and no i do not want outlook for ios ;)

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/twhite2219/selfdrivingcarV1/issues/1#issuecomment-284669772, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQlGsvAt0llN5CLMQOwN3K3fZe73PJBtks5rjSUegaJpZM4MVPBw.

twhite2219 commented 7 years ago

Apologies, I mean MinMaxLoc, and apologies regarding outlook for IOS :)


From: berak notifications@github.com Sent: 07 March 2017 09:36 To: twhite2219/selfdrivingcarV1 Cc: Toby White; Comment Subject: Re: [twhite2219/selfdrivingcarV1] images (#1)

what's modloc ?

(and no i do not want outlook for ios ;)

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/twhite2219/selfdrivingcarV1/issues/1#issuecomment-284669772, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQlGsvAt0llN5CLMQOwN3K3fZe73PJBtks5rjSUegaJpZM4MVPBw.

berak commented 7 years ago

ah, ok. (and i'm just pulling your leg, no worries..)

twhite2219 commented 7 years ago

see earlier message, think you missed it


From: berak notifications@github.com Sent: 07 March 2017 10:21 To: twhite2219/selfdrivingcarV1 Cc: Toby White; Comment Subject: Re: [twhite2219/selfdrivingcarV1] images (#1)

ah, ok. (and i'm just pulling your leg, no worries..)

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/twhite2219/selfdrivingcarV1/issues/1#issuecomment-284681010, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQlGsnw37h_XLLbNhJvx5uuhohAeu2KNks5rjS-5gaJpZM4MVPBw.

berak commented 7 years ago

Modloc Is the part that calculates the highest recieved probablilty from the NN and its location (0,1 or 2) or so i believe.

yes, each output node returns the probability of the resp. label

I think the NN has no reason as to why it doesnt work apart from something related to my setters... the number of iterations/backprop ratio maybe/ layer sizes ... maybe one of those is incorrect?

yes, please try ! (though "incorrect" might be the wrong word, "bad fit for your situation" also try with more hidden nodes, or more / less layers

purely because i do not understand it.

do you know, how an nn works ? to train it, you have to show it an input (100 pixels), and the expected output (3 nodes with probs [0..1]) the expected output for "1" would be (0,1,0)

let me check again, if you're somewhere inconsitent with your labels (the comments are all misleading) 0: left 1: right 2: straight

right ?

twhite2219 commented 7 years ago

I re arranged last night to prioritise the training of directions before going straight so 0=left, 1=right and 2 now forward. I do understand the workings of the NN and MLP in general however I struggled to understand this line of the code within the training algorithm (and wether it was totally neccecary): train_classes.at(i, train_labels.at(i)) = 1.f; and because I do not understand it I cannot rule it out as an error.

OK , Will try changing layer sizes etc and see how that affects it, do you think changing iterations/backprop rate would also help/ what is normal values for both.

berak commented 7 years ago

train_classes.at(i, train_labels.at(i)) = 1.f;

yes, totally nessecary. the responses are initially all 0 (Mat::zeros), if train_labels(i) is 2, this will make the response: (0,0,1)

also, maybe use [0..1] range for data here

x.convertTo(y, CV_32F, 1.0/255);
twhite2219 commented 7 years ago

so in response to this, would the prediction/ real time values have to have this same filter applied.... it is the 1.f part i do not understand

twhite2219 commented 7 years ago

So i Debugged it and made it print the raw result returned from the NN and all are correct. It turns out it is the MinMaxLoc that is not calculating the highest value properly... is there a better way to calculate the highest value???

berak commented 7 years ago

hehe, you're checking min, not max position here

you need:

 cv::minMaxLoc(Result, 0, 0, 0, &max_loc);
twhite2219 commented 7 years ago

I realised. fixed now. all working fully. Thanks berak.