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

Rpi stream images to PC for image recognition #21

Open
Aoi-00 opened this issue May 13, 2022 · 3 comments
Open

Rpi stream images to PC for image recognition #21

Aoi-00 opened this issue May 13, 2022 · 3 comments

Comments

@Aoi-00
Copy link

Aoi-00 commented May 13, 2022

Hi! I chanced upon this project while looking for ways to link my rpi ( & pi camera) to send images continuously to my PC. The PC will then run image recognition and processing (yolov5) on it for my project.

However, most guides I came across shows the pi camera just streaming the feed to a website. Is it possible to send the images to a PC instead for processing? Is there a way I can edit your implementation for this use case? If not, are you able to provide any guidance or codes?

Thank you in advance and sorry for the trouble! Really cool project by the way!

@Nichevo
Copy link

Nichevo commented May 13, 2022

What I did was to stream the images to a Dropbox account folder that is linked on my PC so then the images were immediately available.
The Dropbox api is fairly simple.

@Aoi-00
Copy link
Author

Aoi-00 commented May 13, 2022

Oh! Does this not mean your dropbox folder gets increasingly bigger in size as the stream goes on?

@Nichevo
Copy link

Nichevo commented May 13, 2022

Yes, it will end up using dropbox space but I didn't find it too much of a problem. You can clear them out onto your PC to keep the dropbox not getting too full if that's a problem. If you are streaming large volumes of pictures it might not be ideal and you might be better creating a server connection.

Here is an example of the code which uploads to a dropbox account

import dropbox
import re

TOKEN = 'asdfafdafasf'

dbx = dropbox.Dropbox(TOKEN)
#print(dbx.users_get_current_account())

sfilename = 'dropboxuploadtest3.py'
spath = '/Users/PythonProjects/'
sfile = spath + sfilename

stopath = '/' + sfilename
with open(sfile, "rb") as f:
dbx.files_upload(f.read(), stopath, mode=dropbox.files.WriteMode("overwrite"))

sstorefile = 'piclist.csv'
with open(spath + sstorefile,'a') as file:
file.write(sfilename + ',')

stopath = '/' + sstorefile
sfile = spath + sstorefile
with open(sfile, "rb") as f:
dbx.files_upload(f.read(), stopath, mode=dropbox.files.WriteMode("overwrite"))

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

2 participants