Skip to content
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

Hardwares to use. #124

Open
husyntech opened this issue Nov 17, 2018 · 46 comments
Open

Hardwares to use. #124

husyntech opened this issue Nov 17, 2018 · 46 comments

Comments

@husyntech
Copy link

Hi, I'd like to try it myself with the same hardwares as you've used. I can't seem to find see anywhere what hardwares are used.

I'm assuming raspberry pi with latest upgraded version would be better option, but would it work with pi 0 w?
Also what other components do I need to get started.

@edPratt
Copy link

edPratt commented Nov 28, 2018

I too would find it helpful to have more information on setting up the hardware. Could this be added to the repo?

@hamuchiwa
Copy link
Owner

hamuchiwa commented Nov 30, 2018

@supaabzz @edPratt Actually raspberry pi just sits on top of the car, there is no wiring between the car and pi. For simplicity, you can even choose not to connect an ultrasonic sensor to the pi. Arduino is connected to the remote controller directly. Since controller may vary, it's hard to say there is a standard way to set up.

For connection diagram/photo, take a look here:
Arduino - #61 and #88
Raspberry Pi - #33

@Vishwasnayak
Copy link

Whether arduino is necessary to capture images or is there any other method to capture image while training. Can anyone also tell the benefits of using arduino

@hamuchiwa
Copy link
Owner

Not really a benefits, if you want to use raspberry pi to control rc car, then you need to add some extra stuff.
If you refer how to save an image to file while collecting, you can create a folder named training_images and add the following line to collect_training_data.py after the decoding.

cv2.imwrite('training_images/frame{:>05}.jpg'.format(frame), image)

@Vishwasnayak
Copy link

Can we capture images through mobile or any such devices instead of using pi camera. One of our faculty member suggested us to capture images in mobile is it possible? Can u please tell about this???

@Vishwasnayak
Copy link

Vishwasnayak commented Feb 28, 2019 via email

@hamuchiwa
Copy link
Owner

@Vishwasnayak You can use a usb camera instead of pi camera. Arduino is connected to the remote controller, it has nothing to do with video streaming in this project.

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 1, 2019 via email

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 11, 2019 via email

@hamuchiwa
Copy link
Owner

@Vishwasnayak Ideally, train on one track and run on another. Train/valid split is included in the model, but it's actually better to do a k-folds cross validation in your case. In that case, make sure to collect a lot of data.

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 12, 2019 via email

@hamuchiwa
Copy link
Owner

@Vishwasnayak Yes, it's possible. Use more data and a more complex model can help.

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 14, 2019 via email

@hamuchiwa
Copy link
Owner

@Vishwasnayak Yes, add more layers/neurons, or if the neural network model in OpenCV doesn't work for you well, you can try to create a CNN using Tensorflow.

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 20, 2019 via email

@hamuchiwa
Copy link
Owner

@Vishwasnayak I'm not sure why it's corrupted, maybe try to isolate what's running one by one? Could you also direct future training related questions to #168, and perhaps upload your data? I can do some training with your data, and hope we can figure out where went wrong together.

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 20, 2019 via email

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 22, 2019 via email

@hamuchiwa
Copy link
Owner

@Vishwasnayak If it's too fast, the video streaming couldn't keep up, you need to find a way to slow down the car first before collecting any data. npz fits is created by Numpy, once you start to train the model, it will call load_data function in model.pyto load all npz files. To start collecting images, try to drive on entire track at least two or three times.
This video can give you an idea how fast the car runs:
https://www.youtube.com/watch?v=KrvvmLEQk8o

@ShwetaLalwani
Copy link

Hi @hamuchiwa ,when I'm trying to read . npy file images after running collect_training_data.py, I'm getting all null images. Can you tell me what must be the problem?

@hamuchiwa
Copy link
Owner

@ShwetaLalwani Can you explain a bit more about null image? Are you trying to visualize the data or something else? Images will be reshaped and saved into Numpy array as npz files that will be created in training_data folder.

@ShwetaLalwani
Copy link

@hamuchiwa yes right, I'm trying to open the npz files and look at the images that are captured ... But when I'm opening the images , they are all null (I can't see the path, full image is white). Can you plz help me with this?

@hamuchiwa
Copy link
Owner

@ShwetaLalwani Once you loaded data,
X_train, X_valid, y_train, y_valid = load_data(input_size, data_path)
reshape it back to its original shape, then visualize it.

sample = X_train[0].reshape((120, 320)) # if using whole image, then (240, 320)
plt.imshow(sample, cmap='gray')

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 23, 2019 via email

@hamuchiwa
Copy link
Owner

@Vishwasnayak Image is saved only when key is pressed, so it's more like tapping keys to move the car. Just drive on the track multiple times, or you could switch off the car and place the car on the track where you think it should be, then press arrow keys to collect while manually moving the car.

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 25, 2019 via email

@Gooose1909
Copy link

Gooose1909 commented Mar 25, 2019 via email

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 25, 2019 via email

@Gooose1909
Copy link

Gooose1909 commented Mar 25, 2019 via email

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 25, 2019 via email

@Gooose1909
Copy link

Gooose1909 commented Mar 25, 2019 via email

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 25, 2019 via email

@ShwetaLalwani
Copy link

@Vishwasnayak Are you able to watch the images. Can you plz show me one image? How does it look? Because when I'm opening . Npz files I can't see the images. They are very small like a dot image.

@Gooose1909
Copy link

Gooose1909 commented Mar 27, 2019 via email

@ShwetaLalwani
Copy link

Which folder?

@ShwetaLalwani
Copy link

@Gooose1909 the code that you provided above to open . Npz file is showing output in vector format. So suppose for one image [36,36,37..... 115,115,136] is displayed . Is this correct?

@Gooose1909
Copy link

Gooose1909 commented Mar 27, 2019 via email

@ShwetaLalwani
Copy link

I mean are these values correct 36 37?
What were your values?

@Vishwasnayak
Copy link

Vishwasnayak commented Mar 31, 2019 via email

@Vishwasnayak
Copy link

Vishwasnayak commented Apr 9, 2019 via email

@Vishwasnayak
Copy link

Vishwasnayak commented Apr 10, 2019 via email

@hamuchiwa
Copy link
Owner

@Vishwasnayak Your lag is too large to drive or it's something else...? It's common to have some delays, how many frames can you receive per second?

@Vishwasnayak
Copy link

Vishwasnayak commented Apr 11, 2019 via email

@Vishwasnayak
Copy link

Vishwasnayak commented Apr 12, 2019 via email

@hamuchiwa
Copy link
Owner

@Vishwasnayak I honestly do not have an answer for that, you are using a newer model of raspberry pi and a more powerful computer, maybe something wrong with your internet?

@Vishwasnayak
Copy link

Vishwasnayak commented Apr 12, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants